Skip to main content

Crate use_orientation

Crate use_orientation 

Source
Expand description

§use-orientation

Small 2D winding and collinearity helpers for the RustUse geometry workspace.

§Example

use use_orientation::{Orientation2, orientation_2d};
use use_point::Point2;

assert_eq!(
    orientation_2d(
        Point2::new(0.0, 0.0),
        Point2::new(4.0, 0.0),
        Point2::new(0.0, 3.0),
    ),
    Orientation2::CounterClockwise,
);

Enums§

Orientation2
The winding order of three 2D points.

Functions§

orientation_2d
Returns the winding order of three 2D points.
orientation_2d_with_tolerance
Returns the winding order of three 2D points using an explicit area tolerance.
signed_twice_area_2d
Returns twice the signed area of the triangle formed by three 2D points.
try_orientation_2d
Returns the winding order of three 2D points with finite coordinates.
try_orientation_2d_with_tolerance
Returns the winding order of three finite 2D points using an explicit area tolerance.