ellipsearc

package
v0.0.0-...-9c88ebf Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: BSD-3-Clause Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EllipseArc

type EllipseArc struct {
	Start, Length float64
	// contains filtered or unexported fields
}

EllipseArc fulfills Path and describes an elliptic arc. Start defines where the arc starts and Length defines the arc length, in radians. Start defaults to 0 which is the point on the arc that intersects the ray from foci-1 to foci-2

func New

func New(pt1, pt2 d2.Pt, r float64) *EllipseArc

New returns an EllipseArc with foci f1 and f2 and a minor radius of r. The perimeter point that corresponds to an angle of 0 will be 1/4 rotation going from f1 to f2, which will lie along the minor axis. So an ellipse with foci (0,0) and (0,2) with a minor radius of 1 will have angle 0 at point (1,1).

func (*EllipseArc) ABC

func (e *EllipseArc) ABC(y float64) (float64, float64, float64)

ABC returns the values so the A*x^2 + B*x + C = 0 is true for the ellipse at y.

func (*EllipseArc) Angle

func (e *EllipseArc) Angle() (ang angle.Rad, sin, cos float64)

Angle returns the information about the ellipse rotation angle.

func (*EllipseArc) Axis

func (e *EllipseArc) Axis() (major, minor float64)

Axis returns the lengths of the major and minor axis of the ellipse

func (*EllipseArc) BoundingBox

func (e *EllipseArc) BoundingBox() (min, max d2.Pt)

BoundingBox fulfills shape.BoundingBoxer. It returns a min and max that are the corners of a bounding rectangle that will contain the ellipse arc. This ignores the start and end of the arc so it may not be the minimal bounding box.

func (*EllipseArc) ByAngle

func (e *EllipseArc) ByAngle(a float64) d2.V

ByAngle returns the vector at the given angle relative to the center

func (*EllipseArc) Centroid

func (e *EllipseArc) Centroid() d2.Pt

Centroid of the ellipse

func (*EllipseArc) Foci

func (e *EllipseArc) Foci() (d2.Pt, d2.Pt)

Foci of the ellipse

func (*EllipseArc) LineIntersections

func (e *EllipseArc) LineIntersections(l line.Line, buf []float64) []float64

LineIntersections fulfills line.LineIntersector. Returns the points on the line that intersect the EllipseArc relative to the line.

func (*EllipseArc) Pt1

func (e *EllipseArc) Pt1(t float64) d2.Pt

Pt1 returns the float64 vector at t.

func (*EllipseArc) V1

func (e *EllipseArc) V1(t float64) d2.V

V1 returns a tangent vector at t.

Jump to

Keyboard shortcuts

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