A Cone3d
consists of a conical outer surface, a circular base and a tip;
it is defined by its center point on the base, axial direction, radius and overall
length. This module contains functionality for:
Geometry.Types.Cone3d units coordinates
along : Axis3d units coordinates -> { base : Quantity Basics.Float units, tip : Quantity Basics.Float units, radius : Quantity Basics.Float units } -> Cone3d units coordinates
Construct a cone that lies along the given axis, with the center of the base and tip points given as (signed) distances along that axis:
exampleCone =
Cone3d.along Axis3d.x
{ base = Length.meters -1
, tip = Length.meters 3
, radius = Length.meters 1
}
Cone3d.basePoint exampleCone
--> Point3d.meters -1 0 0
Cone3d.tipPoint exampleCone
--> Point3d.meters 3 0 0
Cone3d.length exampleCone
--> Length.meters 4
Note that tip
may be less than base
, but then the axial direction of the
returned cone will be the opposite of the axial direction of the given axis.
startingAt : Point3d units coordinates -> Direction3d coordinates -> { radius : Quantity Basics.Float units, length : Quantity Basics.Float units } -> Cone3d units coordinates
Construct a cone given the center point on the base, axial direction towards the tip, radius and length. Negative values for radius or length will be treated as positive (the absolute values will be used).
from : Point3d units coordinates -> Point3d units coordinates -> Quantity Basics.Float units -> Maybe (Cone3d units coordinates)
Attempt to construct a cone from the given center point on the base,
tip point and radius. If the base and tip points are coincident (the same point),
returns Nothing
.
axis : Cone3d units coordinates -> Axis3d units coordinates
Get the central axis of a cone. The origin point of the axis will be at the center point of the base, and the direction of the axis will be from the cone's base point towards its tip.
axialDirection : Cone3d units coordinates -> Direction3d coordinates
Get the axial direction of a cone.
radius : Cone3d units coordinates -> Quantity Basics.Float units
Get the base radius of a cone.
diameter : Cone3d units coordinates -> Quantity Basics.Float units
Get the base diameter of a cone (twice its radius).
length : Cone3d units coordinates -> Quantity Basics.Float units
Get the overall length of a cone.
basePoint : Cone3d units coordinates -> Point3d units coordinates
Get the base point of a cone. This is the center point of the circle that forms the base of the cone.
tipPoint : Cone3d units coordinates -> Point3d units coordinates
Get the tip point of a cone.
base : Cone3d units coordinates -> Circle3d units coordinates
Get the circle at the base of a cone. The axial direction of this circle will be the reverse of the axial direction of the cone itself (the circle axial direction will point backwards/outwards).
basePlane : Cone3d units coordinates -> Plane3d units coordinates
Get the plane at the base of a cone. The normal direction of this plane will be the same as the axial direction of the cone itself.
volume : Cone3d units coordinates -> Quantity Basics.Float (Quantity.Cubed units)
Get the volume of a cone.
boundingBox : Cone3d units coordinates -> BoundingBox3d units coordinates
Get the minimal bounding box containing a given cone.
contains : Point3d units coordinates -> Cone3d units coordinates -> Basics.Bool
Check if a cone contains a given point.
Transformations generally behave just like the ones in the
Point3d
module.
scaleAbout : Point3d units coordinates -> Basics.Float -> Cone3d units coordinates -> Cone3d units coordinates
Scale a cone about a given point by a given scale.
rotateAround : Axis3d units coordinates -> Angle -> Cone3d units coordinates -> Cone3d units coordinates
Rotate a cone around a given axis by a given angle.
translateBy : Vector3d units coordinates -> Cone3d units coordinates -> Cone3d units coordinates
Translate a cone by a given displacement.
translateIn : Direction3d coordinates -> Quantity Basics.Float units -> Cone3d units coordinates -> Cone3d units coordinates
Translate a cone in a given direction by a given distance.
mirrorAcross : Plane3d units coordinates -> Cone3d units coordinates -> Cone3d units coordinates
Mirror a cone across a given plane.
at : Quantity Basics.Float (Quantity.Rate units2 units1) -> Cone3d units1 coordinates -> Cone3d units2 coordinates
Convert a cone from one units type to another, by providing a conversion factor given as a rate of change of destination units with respect to source units.
at_ : Quantity Basics.Float (Quantity.Rate units1 units2) -> Cone3d units1 coordinates -> Cone3d units2 coordinates
Convert a cone from one units type to another, by providing an 'inverse' conversion factor given as a rate of change of source units with respect to destination units.
placeIn : Frame3d units globalCoordinates { defines : localCoordinates } -> Cone3d units localCoordinates -> Cone3d units globalCoordinates
Take a cone considered to be defined in local coordinates relative to a given reference frame, and return that cone expressed in global coordinates.
relativeTo : Frame3d units globalCoordinates { defines : localCoordinates } -> Cone3d units globalCoordinates -> Cone3d units localCoordinates
Take a cone defined in global coordinates, and return it expressed in local coordinates relative to a given reference frame.