Versions in this module Expand all Collapse all v0 v0.4.0 Jan 22, 2025 v0.3.9 Jan 16, 2025 Changes in this version type AffineMatrix + func NewTranslateMat(src, dst Point) AffineMatrix + func (m AffineMatrix) RotationAngle() float64 v0.3.8 Dec 29, 2024 v0.3.7 Dec 25, 2024 v0.3.6 Dec 17, 2024 v0.3.5 Dec 16, 2024 Changes in this version + func InverseMatrix(m [3][3]float64) ([3][3]float64, error) + type GeneralFormLine struct + A float64 + B float64 + C float64 + func (l *GeneralFormLine) ToSlopeInterceptLine() *SlopeInterceptFormLine + func (l *GeneralFormLine) ToStraightLine() *StraightLine type LineSegment + func NewLineSegment(start, end Point) *LineSegment + func (l *LineSegment) ContainsPoint(p Point) bool + func (l *LineSegment) IntersectionLineSegment(l2 *LineSegment) (Point, bool) + func (l *LineSegment) IntersectionRay(r *Ray) (Point, bool) + func (l *LineSegment) IntersectionStraightLine(sl *StraightLine) (Point, bool) + func (l *LineSegment) ToSlopeInterceptFormLine() *SlopeInterceptFormLine + type LineSegmentInt struct + End PointInt[T] + Start PointInt[T] + func (l *LineSegmentInt[T]) ToFloat64(factor float64) *LineSegment type Polygon + func (p Polygon) ContainsPoint(point Point) bool + type PolynomialCurve struct + Angle float64 + Coefficients []float64 + func (p *PolynomialCurve) ZeroAngleY(x float64) float64 + type Ray struct + Angle float64 + func NewRay(p Point, angle float64) *Ray + func (l *Ray) IntersectRay(l2 *Ray) bool + func (r *Ray) IntersectionRay(r2 *Ray) (Point, bool) + func (r *Ray) IntersectionStraightLine(l *StraightLine) (Point, bool) + func (r *Ray) IsOnForwardRange(p Point) bool + type SineWave struct + Amplitude float64 + Angle float64 + Frequency float64 + PhaseShift float64 + VerticalShift float64 + func (p *SineWave) ZeroAngleY(x float64) float64 + type SlopeInterceptFormLine struct + Intercept float64 + Slope float64 + func (l *SlopeInterceptFormLine) IsVertical() bool + func (l *SlopeInterceptFormLine) ToGeneralFormLine() *GeneralFormLine + func (l *SlopeInterceptFormLine) ToStraightLine() *StraightLine type StraightLine + Angle float64 + func NewStraightLine(p Point, angle float64) *StraightLine + func (l *StraightLine) ContainsPoint(p Point) bool + func (l *StraightLine) IntersectStraightLine(l2 *StraightLine) bool + func (l *StraightLine) IntersectionStraightLine(l2 *StraightLine) (Point, bool) + func (l *StraightLine) ToGeneralFormLine() *GeneralFormLine type Vector + func (v Vector) CrossProduct(v2 Vector) float64 v0.3.4 Dec 9, 2024 Changes in this version + func AngleDegrees(angleRadian float64) float64 + func AngleRadian(angleDegrees float64) float64 + func GaussJordanElimination(A [][]float64, b []float64) ([]float64, error) + func NormalizeAngleDegrees(theta float64) float64 + func NormalizeAngleRadian(theta float64) float64 + type AffineMatrix [2][3]float64 + func NewAffineMatrix(p1, p2, p3, q1, q2, q3 Point) (AffineMatrix, error) + func NewRotationMat(center Point, angleDeg float64) AffineMatrix + func NewTranslateRotationMat(pA, pB Point, angleDeg float64) AffineMatrix + func (m AffineMatrix) Transform(p Point) Point + type Bounds struct + Max Point + Min Point + func BoundsFromImageRect(r image.Rectangle) *Bounds + func NewBounds(x0, y0, x1, y1 float64) *Bounds + func (b *Bounds) ToRect() *Rectangle + type Circle struct + Centre Point + Diameter float64 + func (c *Circle) Bounds() *Bounds + type CircleInt struct + Center PointInt[T] + Diameter T + func (e *CircleInt[T]) ToFloat64(factor float64) *Circle + type CircularArc struct + Circle Circle + EndAngle float64 + StartAngle float64 + func CircularArcFromPoints(center, start, end Point) *CircularArc + func NewCircularArc(circle Circle, startAngle, endAngle float64) *CircularArc + func (a *CircularArc) Bounds() *Bounds + func (a *CircularArc) Sample(samples int) []Point + type CircularArc2 struct + Center Point + End Point + Start Point + func NewCircularArc2(center, start, end Point) *CircularArc2 + func (a *CircularArc2) ToCircularArc() *CircularArc + type CircularArcInt struct + Circle CircleInt[T] + EndAngle float64 + StartAngle float64 + func ArcIntFromFloat64[T constraints.Integer](e *CircularArc, factor float64) *CircularArcInt[T] + func (e *CircularArcInt[T]) ToFloat64(factor float64) *CircularArc + type Contour struct + Segments []Segment + Start Point + type Coord struct + func (c Coord) GetOuterPoints(points []Point) [4]Point + type Ellipse struct + Angle float64 + Centre Point + MajorAxis float64 + MinorAxis float64 + func (e *Ellipse) Area() float64 + func (e *Ellipse) GetHalfAxes() (float64, float64) + func (e *Ellipse) Perimeter() float64 + type EllipticalArc struct + EndAngle float64 + StartAngle float64 + type Interpolation int + const InterpolationCCW + const InterpolationClockwise + type LineInt struct + End PointInt[T] + Start PointInt[T] + func LineIntFromFloat64[T constraints.Integer](e *LineSegment, factor float64) *LineInt[T] + func (l *LineInt[T]) ToFloat64(factor float64) *LineSegment + type LineSegment struct + End Point + Start Point + func (l *LineSegment) StraightLine() *SlopeInterceptLine + func (l *LineSegment) Vector() Vector + type Point struct + X float64 + Y float64 + func Pt(x, y float64) Point + func RandomPoint(min, max Point) Point + func (p Point) Length(p2 Point) float64 + func (p Point) Mirror(line *StraightLine) Point + func (p Point) Rotate(center Point, angleDeg float64) Point + func (p Point) Vector(point Point) Vector + type Point3D struct + X float64 + Y float64 + Z float64 + type Point3DInt struct + X T + Y T + Z T + func (l *Point3DInt[T]) ToFloat64(factor float64) *Point3D + type PointInt struct + X T + Y T + func (l *PointInt[T]) ToFloat64(factor float64) *Point + type Polygon []Point + type Rectangle struct + Angle float64 + Center Point + Height float64 + Width float64 + func NewRect(center Point, width, height float64, angleDeg float64) *Rectangle + func RectFromCorners(points [4]Point) *Rectangle + func RectFromImageRect(r image.Rectangle) *Rectangle + func RectNoRotate(x0, y0, x1, y1 float64) *Rectangle + func RectNoRotate2(ltp, rdp Point) *Rectangle + func (rect *Rectangle) Bounds() *Bounds + func (rect *Rectangle) ContainsPoint(p Point) bool + func (rect *Rectangle) Corners() [4]Point + type RectangleInt struct + Angle float64 + Center PointInt[T] + Height T + Width T + func NewRectInt[T constraints.Integer](center PointInt[T], width, height T, angle float64) *RectangleInt[T] + func RectIntFromFloat64[T constraints.Integer](e *Rectangle, factor float64) *RectangleInt[T] + func (rect *RectangleInt[T]) ToFloat64(factor float64) *Rectangle + type RegularPolygon struct + Centre Point + Radius float64 + Sides int + type Segment struct + Centre Point + End Point + Interpolation Interpolation + type SlopeInterceptLine struct + B float64 + Slope float64 + func NewSlopeInterceptLine(m, b float64) *SlopeInterceptLine + func (l *SlopeInterceptLine) IsVertical() bool + func (l *SlopeInterceptLine) ToGeneralFormLine() *StraightLine + type StraightLine struct + A float64 + B float64 + C float64 + func NewGeneralFormLine(a, b, c float64) *StraightLine + func (l *StraightLine) ToSlopeInterceptLine() *SlopeInterceptLine + type Triangle struct + A Point + B Point + C Point + type Vector struct + X float64 + Y float64 + func NewVector(p1, p2 Point) Vector + func (v Vector) Angle() float64 + func (v Vector) AngleWith(v2 Vector) float64 + func (v Vector) Length() float64 + type VectorInt struct + X T + Y T + func (l *VectorInt[T]) ToFloat64(factor float64) *Vector