Documentation ¶
Overview ¶
Package r2 provides 2D vectors and boxes and operations on them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Rotation ¶ added in v0.9.0
type Rotation struct {
// contains filtered or unexported fields
}
Rotation describes a rotation in 2D.
func NewRotation ¶ added in v0.9.0
NewRotation creates a rotation by alpha, around p.
type Vec ¶
type Vec struct {
X, Y float64
}
Vec is a 2D vector.
func Rotate ¶ added in v0.9.0
Rotate returns a new vector, rotated by alpha around the provided point, q.
func Unit ¶ added in v0.8.0
Unit returns the unit vector colinear to p. Unit returns {NaN,NaN} for the zero vector.
func (Vec) Rotate ¶ added in v0.9.0
Rotate returns a new vector, rotated by alpha around the provided point, q.
DEPRECATED: use r2.Rotate.
Click to show internal directories.
Click to hide internal directories.