Type | Description |
Function or value | Description |
|
![]() ![]() ![]() ![]() ![]() ![]() Construct a point along an axis at a particular distance from the axis' origin point. Positive and negative distances will be interpreted relative to the direction of the axis.
|
|
|
|
![]() ![]() ![]() ![]() ![]() ![]() Find the centroid (average) of one or more points, by passing the first point and then all remaining points. This allows this function to return a `Point2d` instead of a `Maybe Point2d`. You would generally use `centroid` within a `case` expression. Alternatively, you can use [`centroidN`](#centroidN) instead.
|
|
![]() ![]() ![]() ![]() ![]() ![]() Find the centroid of three points `Point2D.centroid3d p1 p2 p3` is equivalent to `Point2d.centroid p1 [ p2, p3 ]` but is more efficient.
|
|
![]() ![]() ![]() ![]() ![]() ![]() Find the centroid of a list of _N_ points. If the list is empty, returns `Nothing`. If you know you have at least one point, you can use [`centroid`](#centroid) instead to avoid the `Option`.
|
|
![]() ![]() ![]() ![]() ![]() ![]() Like `centroid`, but lets you work with any kind of data as long as a point can be extracted/constructed from it. For example, to get the centroid of a bunch of vertices.
|
|
|
|
|
|
![]() ![]() ![]() ![]() ![]() ![]() Get the X and Y coordinates of a point relative to a given frame, as a tuple; these are the coordinates the point would have as viewed by an observer in that frame. |
Full Usage:
direction point
Parameters:
Point2D<'Units, 'Coordinates>
Returns: Direction2D<'Coordinates> option
|
|
|
|
|
|
|
|
|
![]() ![]() ![]() ![]() ![]() ![]() Compare two points within a tolerance. Returns true if the distance between the two given points is less than the given tolerance.
|
|
|
Full Usage:
fromList list
Parameters:
float list
Returns: Point2D<'Units, 'Coordinates> option
|
|
|
|
|
![]() ![]() ![]() ![]() ![]() ![]() Construct a point by interpolating from the first given point to the second, based on a parameter that ranges from zero to one. You can pass values less than zero or greater than one to extrapolate.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![]() ![]() ![]() ![]() ![]() ![]() Mirror a point across an axis. The result will be the same distance from the axis but on the opposite side.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![]() ![]() ![]() ![]() ![]() ![]() Take a point defined in global coordinates, and return it expressed in local coordinates relative to a given reference frame.
|
|
|
|
|
|
|
|
|
|
![]() ![]() ![]() ![]() ![]() ![]() Perform a uniform scaling about the given center point. The center point is given first and the point to transform is given last. Points will contract or expand about the center point by the given scale. Scaling by a factor of 1 is a no-op, and scaling by a factor of 0 collapses all points to the center point. Avoid scaling by a negative scaling factor - while this may sometimes do what you want it is confusing and error prone. Try a combination of mirror and/or rotation operations instead.
|
|
|
|
![]() ![]() ![]() ![]() ![]() ![]() Determine how far along an axis a particular point lies. Conceptually, the point is projected perpendicularly onto the axis, and then the distance of this projected point from the axis' origin point is measured. The result will be positive if the projected point is ahead the axis' origin point and negative if it is behind, with 'ahead' and 'behind' defined by the direction of the axis.
|
|
![]() ![]() ![]() ![]() ![]() ![]() Find the perpendicular distance of a point from an axis. The result will be positive if the point is to the left of the axis and negative if it is to the right, with the forwards direction defined by the direction of the axis.
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
translateIn d distance p
Parameters:
Direction2D<'Coordinates>
distance : Quantity<'Units>
p : Point2D<'Units, 'Coordiantes>
Returns: Point2D<'Units, 'Coordiantes>
|
|
|
|
|
|
|
![]() ![]() ![]() ![]() ![]() ![]() Be careful with the vector arguments. This function is written with piping in mind. The first point is the target location. The second point is the starting location. This is also an alias for `minus` and is `target - from`
|
|
|
|
|
|
|
|
|
|
|
|
|