pub enum Side {
    Positive,
    Negative,
}
Expand description

The positive or negative side of a vector or segment.

Given a reference vector v0, a vector v1 is on the positive side if the sign of the cross product v0 x v1 is positive.

This type does not use the left/right terminology to avoid confusion with left-handed / right-handed coordinate systems. Right-handed coordinate systems seem to be what a lot of people are most familiar with (especially in 2D), however most vector graphics specifications use y-down left-handed coordinate systems. Unfortunately mirroring the y axis inverts the meaning of “left” and “right”, which causes confusion. In practice:

  • In a y-down left-handed coordinate system such as SVG’s, Side::Positive is the right side.
  • In a y-up right-handed coordinate system, Side::Positive is the left side.

Variants§

§

Positive

§

Negative

Implementations§

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.