Module cavalier_contours::core::math
source · Expand description
Core/common math functions for working with angles, 2D space, intersections, etc.
Structs§
Enums§
- Holds the result of finding the intersect between two circles.
- Holds the result of finding the intersect between a line segment and a circle.
- Holds the result of finding the intersect between two line segments.
Functions§
- Angle of the direction vector described by
p0
top1
. - Returns the arc sweep angle for the given
bulge
. - Same as angle_is_between_eps using default epsilon.
- Tests if
test_angle
is between astart_angle
andend_angle
. - Same as angle_is_within_sweep_eps using default epsilon.
- Tests if
test_angle
is within thesweep_angle
starting atstart_angle
. - Returns the bulge for the given arc
sweep_angle
. - Finds the intersects between two circles defined by the radius and center.
- Returns the smaller difference between two angles.
- Returns the smaller difference between two angles and applies the sign given.
- Distance squared between the points
p0
andp1
. - Returns true if
point
is left of a direction vector. - Same as is_left_or_coincident_eps using default epsilon.
- Returns true if
point
is left of a direction vector with fuzzy inclusion. - Same as is_left but uses <= operator rather than < for boundary inclusion.
- Same as is_right_or_coincident_eps using default epsilon.
- Returns true if
point
is right of a direction vector with fuzzy inclusion. - Finds the intersects between a line segment and a circle.
- Finds the intersects between two lines segments.
- Returns the closest point on the line segment from
p0
top1
to thepoint
given. - Midpoint of a line segment defined by
p0
top1
. - Returns the (min, max) values from
v1
andv2
. - Normalize radians to be between
0
and2PI
, e.g.-PI/4
becomes7PI/4
and5PI
becomesPI
. - Returns the parametric value on the line segment going from
p0
top1
at thepoint
given. - Returns the point on the line segment going from
p0
top1
at parametric valuet
. - Returns the point on the circle with
radius
,center
, and polarangle
in radians given. - Test if a
point
is within a arc sweep angle region. - Returns the solutions to the quadratic equation.