Trait polygon::Polygon [] [src]

pub trait Polygon: Sized {
    fn translate(&self, _: f64, _: f64) -> Self;
    fn rotate_radians(&self, _: f64) -> Self;
    fn angles_radians(&self) -> Vec<f64>;
    fn collides_with<P: Polygon>(&self, _: &P) -> Self;
    fn shadow(&self, _: f64) -> [f64; 2];
    fn enlarge(&self, _: f64) -> Self;

    fn translate_x(&self, x: f64) -> Self { ... }
    fn translate_y(&self, y: f64) -> Self { ... }
    fn rotate_degrees(&self, r: f64) -> Self { ... }
    fn angles_degrees(&self) -> Vec<f64> { ... }
    fn angles_gradients(&self) -> Vec<f64> { ... }
    fn normals_radians(&self) -> Vec<f64> { ... }
    fn normals_degrees(&self) -> Vec<f64> { ... }
    fn normals_gradients(&self) -> Vec<f64> { ... }
    fn rotate_about_radians(&self, x: f64, y: f64, r: f64) -> Self { ... }
    fn rotate_about_degrees(&self, x: f64, y: f64, r: f64) -> Self { ... }
    fn enlarge_about(&self, x: f64, y: f64, s: f64) -> Self { ... }
    fn trans(&self, x: f64, y: f64) -> Self { ... }
    fn rot_rad(&self, r: f64) -> Self { ... }
    fn trans_x(&self, x: f64) -> Self { ... }
    fn trans_y(&self, y: f64) -> Self { ... }
    fn rot_deg(&self, r: f64) -> Self { ... }
    fn rot_about_rad(&self, x: f64, y: f64, r: f64) -> Self { ... }
    fn rot_about_deg(&self, x: f64, y: f64, r: f64) -> Self { ... }
    fn ang_rad(&self) -> Vec<f64> { ... }
    fn ang_deg(&self) -> Vec<f64> { ... }
    fn ang_grad(&self) -> Vec<f64> { ... }
    fn norm_rad(&self) -> Vec<f64> { ... }
    fn norm_deg(&self) -> Vec<f64> { ... }
    fn norm_grad(&self) -> Vec<f64> { ... }
}

Functions for manipulating a polygon.

Required Methods

translate(x, y)

Translate polygon by (x, y).

rotate_radians(r)

Rotate polygon about (0, 0) by r radians.

angles_radians()

Get a slice of all of the angles of lines present in the polygon in radians

collides_with(&rhs)

Check if polygon collides with another polygon (rhs).

shadow(r)

Returns the shadow cast by the polygon by a light source incident at angle r as an initial and final position relative to the origin across the normal of r.

enlarge(s)

Enlarge about (0, 0) with scale factor s.

Provided Methods

Translate polygon by (x, 0)

Translate polygon by (0, y)

Rotate polygon about (0, 0) by r degrees.

Get a slice of all the angles of lines present in the polygon in degrees

Get a slice of all of the angles of lines present in the polygon as a gradients

Get a slice of all of the angles of normals to lines present in the polygon in radians

Get a slice of all of the angles of normals to lines present in the polygon in degrees

Get a slice of all of the angles of normals to lines present in the polygon as a gradients

Rotate polygon about (x, y) by r radians.

Rotate polygon about (x, y) by r degrees.

Enlarge polygon about (x, y) by a scale factor s.

Alias for Polygon::translate

Alias for Polygon::rotate_radians

Alias for Polygon::translate_x

Alias for Polygon::translate_y

Alias for Polygon::rotate_degrees

Alias for Polygon::rotate_about_radians

Alias for Polygon::rotate_about_degrees

Alias for Polygon::angles_radians

Alias for Polygon::angles_degrees

Alias for Polygon::angles_gradients

Alias for Polygon::normals_radians

Alias for Polygon::normals_degrees

Alias for Polygon::normals_gradients

Implementors