Documentation ¶
Overview ¶
Package math2 provides 2D math helpers.
Index ¶
- type Angle
- type Point
- func (p Point) Add(p2 Point) Point
- func (p Point) CoordinatesFromAngleDist(a Angle, length float64) Point
- func (p Point) Div(p2 Point) Point
- func (p Point) GetAngle(p2 Point) Angle
- func (p Point) Magnitude(p2 Point) float64
- func (p Point) Mul(p2 Point) Point
- func (p Point) Norm() float64
- func (p Point) Rotate(alpha Angle) Point
- func (p Point) Scale(n float64) Point
- func (p Point) String() string
- func (p Point) Sub(p2 Point) Point
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Angle ¶
type Angle float64
Angle helper type.
func NewDegAngle ¶
NewDegAngle returns a new angle from a degrees values.
func NewRadAngle ¶
NewRadAngle returns a new angle from a radians value.
type Point ¶
type Point struct{ X, Y float64 }
Point represents a 2D point.
func CoordinatesFromAngleDist ¶
CoordinatesFromAngleDist returns the coordinates from 0,0 of a point p1 offseted by origin from an angle and length.
func (Point) CoordinatesFromAngleDist ¶
CoordinatesFromAngleDist returns the coordinates from 0,0 of the point from an angle and length.
Click to show internal directories.
Click to hide internal directories.