point

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Point

type Point struct {
	X, Y, Z float64
}

Point is an object used for specifying the outline of a face.

func P

func P[T int | float64](x, y, z T) Point

func Pt

func Pt(x, y, z float64) Point

func (Point) Cross

func (l Point) Cross(r Point) Point

func (Point) DividedBy

func (v Point) DividedBy(a float64) Point

func (Point) Dot

func (l Point) Dot(r Point) float64

func (Point) Equal

func (l Point) Equal(r Point) bool

func (Point) Length

func (p Point) Length() float64

Length calculates the length of the X,Y,Z component vector

func (Point) Lerp

func (v Point) Lerp(a Point, t float64) Point

func (Point) Minus

func (v Point) Minus(a Point) Point

func (Point) Mul

func (p Point) Mul(M matrix.Matrix) Point

Mul returns point p transformed by matrix M, i.e. p' = Mp

func (Point) Negated

func (v Point) Negated() Point

func (Point) Normalize

func (p Point) Normalize() Point

Normalize returns a pointer to a copy of the Point after normalizing the copy so the vector length is 1.0

func (Point) Perpendicular

func (p Point) Perpendicular() Point

func (Point) Plus

func (v Point) Plus(a Point) Point

func (Point) PointAngle

func (p Point) PointAngle(angle float64) quaternion.Quat

PointAngle returns a quaternion representing a rotation around the axis defined by the point p. The rotation angle is specified in radians.

func (Point) Round

func (p Point) Round() Point

Round rounds the X,Y,Z components to the nearest integer value.

func (Point) Times

func (v Point) Times(a float64) Point

func (Point) Unit

func (v Point) Unit() Point

type Points

type Points []Point

func (Points) Barycenter

func (points Points) Barycenter() Point

Barycenter of the points is used in sorting faces in the painters algorithm.

func (Points) Clip

func (points Points) Clip(m matrix.Matrix, Z float64, clippedPoints Points) bool

func (Points) Mul

func (points Points) Mul(m matrix.Matrix) Points

func (Points) MulB

func (points Points) MulB(m matrix.Matrix, outPoints Points) (barycenter Point)

func (Points) Normal

func (points Points) Normal() Point

Normal returns the normal (not normalize) for a slice of points. Can be used for e.g. backface culling or shading.

func (Points) Round

func (points Points) Round()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL