ianmackenzie/elm-geometry/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

Arc2d

Arc2d

An Arc2d is a section of a circle, defined by its center point, start point and swept angle (the counterclockwise angle from the start point to the end point). This module includes functionality for

  • Constructing arcs through given points and/or with a given radius
  • Scaling, rotating, translating and mirroring arcs
  • Converting arcs between different coordinate systems
type alias Arc2d =
Arc2d

Constructors

from : Point2d -> Point2d -> Float -> Arc2d
{ centerPoint : Point2d
, radius : Float
, startAngle : Float
, sweptAngle : Float
}
-> Arc2d
sweptAround : Point2d -> Float -> Point2d -> Arc2d
throughPoints : Point2d -> Point2d -> Point2d -> Maybe Arc2d
withRadius : Float -> SweptAngle -> Point2d -> Point2d -> Maybe Arc2d

Properties

centerPoint : Arc2d -> Point2d
radius : Arc2d -> Float
startPoint : Arc2d -> Point2d
endPoint : Arc2d -> Point2d
sweptAngle : Arc2d -> Float

Evaluation

pointOn : Arc2d -> ParameterValue -> Point2d
pointsAt : List ParameterValue -> Arc2d -> List Point2d
nondegenerate : Arc2d -> Result Point2d Nondegenerate
fromNondegenerate : Nondegenerate -> Arc2d
tangentDirection : Nondegenerate -> ParameterValue -> Direction2d
tangentDirectionsAt : List ParameterValue -> Nondegenerate -> List Direction2d
sample : Nondegenerate -> ParameterValue -> ( Point2d, Direction2d )
List ParameterValue
-> Nondegenerate
-> List ( Point2d, Direction2d )

Linear approximation

toPolyline : { maxError : Float } -> Arc2d -> Polyline2d

Transformations

reverse : Arc2d -> Arc2d
scaleAbout : Point2d -> Float -> Arc2d -> Arc2d
rotateAround : Point2d -> Float -> Arc2d -> Arc2d
translateBy : Vector2d -> Arc2d -> Arc2d
translateIn : Direction2d -> Float -> Arc2d -> Arc2d
mirrorAcross : Axis2d -> Arc2d -> Arc2d

Coordinate conversions

relativeTo : Frame2d -> Arc2d -> Arc2d
placeIn : Frame2d -> Arc2d -> Arc2d

Differentiation

You are unlikely to need to use these functions directly, but they are useful if you are writing low-level geometric algorithms.

firstDerivative : Arc2d -> ParameterValue -> Vector2d
firstDerivativesAt : List ParameterValue -> Arc2d -> List Vector2d