Documentation ¶
Overview ¶
Package plane implements mathematical objects and operations in the plane.
Index ¶
- func Apply(m Matrix, v coord.XYZ) coord.XYZ
- func Circumcenter(a, b, c coord.XY) coord.XY
- func InCircumcircle(a, b, c coord.XY, p coord.XY) bool
- func InTriangle(a, b, c coord.XY, p coord.XY) bool
- func InTriangleCCW(a, b, c coord.XY, p coord.XY) bool
- func IsCCW(a, b, c coord.XY) bool
- func Orientation(a, b, c coord.XY) float32
- type GPUMatrix
- type Matrix
- func Identity() Matrix
- func Rotation(angle float32) Matrix
- func RotationAround(angle float32, center coord.XY) Matrix
- func Scaling(s coord.XY) Matrix
- func ScalingAround(s coord.XY, center coord.XY) Matrix
- func Shearing(s coord.XY) Matrix
- func Translation(t coord.XY) Matrix
- func Viewport(zoom, aspectRatio float32) Matrix
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply a tranformation matrix to a vector (i.e. returns matrix multiplied by column vector).
func Circumcenter ¶
Circumcenter returns the coordinates of the circumcenter of triangle a b c.
func InCircumcircle ¶
InCircumcircle returns true if p is inside the circumcircle of triangle a b c (which must be in counter-clockwise order)
func InTriangle ¶
InTriangle returns true if p is inside the triangle a b c.
func InTriangleCCW ¶
InTriangleCCW returns true if p is inside the triangle a b c (which must be in counter-clockwise order).
func Orientation ¶
Orientation returns a psitive value if the triangle a b c is in counter-clockwise order, a negative value if it is in clockwise order, and a null value if a b and c are colinear.
Types ¶
type GPUMatrix ¶
type GPUMatrix [3][4]float32
GPUMatrix represents a transformation matrix with a memory layout compatible with the GPU.
type Matrix ¶
type Matrix [3][3]float32
Matrix represents a transformation matrix.
Note: due to alignment rules, it's not possible to pass a Matrix directly to the GPU. You should convert it to a GPUMatrix first.
func RotationAround ¶
RotationAround a point.
func ScalingAround ¶
ScalingAround a point (and/or mirror).
func (Matrix) Translation ¶
Translation returns the translation vector of the transformation matrix.
func (Matrix) WithoutTranslation ¶
WithoutTranslation returns the transformation matrix with the translation part removed.
Directories ¶
Path | Synopsis |
---|---|
Package quadedge provides a way to describe and manipulate the topology of planar maps (i.e., the topology of any closed polygonal mesh).
|
Package quadedge provides a way to describe and manipulate the topology of planar maps (i.e., the topology of any closed polygonal mesh). |