Struct graphics_shapes::triangle::Triangle
source · pub struct Triangle { /* private fields */ }
Implementations§
source§impl Triangle
impl Triangle
pub fn angles(&self) -> [isize; 3]
pub fn angle_type(&self) -> &TriangleAngleType
pub fn side_type(&self) -> &TriangleSideType
source§impl Triangle
impl Triangle
pub fn as_rect(&self) -> Rect
pub fn right_angle<P: Into<Coord>>(
angle_coord: P,
width: usize,
height: usize,
angle_position: AnglePosition
) -> Triangle
sourcepub fn equilateral<P: Into<Coord>>(
center: P,
size: usize,
flat_side: FlatSide
) -> Triangle
pub fn equilateral<P: Into<Coord>>(
center: P,
size: usize,
flat_side: FlatSide
) -> Triangle
Create an equilateral triangle with width and height of [size] around [center] The top left would be (center.x - size / 2, center.y + size / 2) and bottom right (center.x + size / 2, center.y + size / 2)
Trait Implementations§
source§impl Shape for Triangle
impl Shape for Triangle
source§fn from_points(points: Vec<Coord>) -> Selfwhere
Self: Sized,
fn from_points(points: Vec<Coord>) -> Selfwhere
Self: Sized,
create this shape from a list of points
source§fn translate_by<P: Into<Coord>>(&self, delta: P) -> Selfwhere
Self: Sized,
fn translate_by<P: Into<Coord>>(&self, delta: P) -> Selfwhere
Self: Sized,
change every point by +
delta
source§fn move_to<P: Into<Coord>>(&self, point: P) -> Selfwhere
Self: Sized,
fn move_to<P: Into<Coord>>(&self, point: P) -> Selfwhere
Self: Sized,
moves the shapes first point to
point
(and changes every other point to match their original distance and angle) Read more