pub struct Triangle {
pub a: Point,
pub b: Point,
pub c: Point,
}Expand description
Triangle
Fields§
§a: Pointvertex a.
b: Pointvertex b.
c: Pointvertex c.
Implementations§
Source§impl Triangle
impl Triangle
Sourcepub const EQUILATERAL: Self
pub const EQUILATERAL: Self
Equilateral Triangle with the x-axis unit vector as its base.
Sourcepub const fn from_coords(a: (f64, f64), b: (f64, f64), c: (f64, f64)) -> Self
pub const fn from_coords(a: (f64, f64), b: (f64, f64), c: (f64, f64)) -> Self
A new Triangle from three float vertex coordinates.
Works as a constant Triangle::new.
Sourcepub fn is_zero_area(&self) -> bool
pub fn is_zero_area(&self) -> bool
Whether this Triangle has zero area.
Sourcepub fn inscribed_circle(&self) -> Circle
pub fn inscribed_circle(&self) -> Circle
Sourcepub fn circumscribed_circle(&self) -> Circle
pub fn circumscribed_circle(&self) -> Circle
Trait Implementations§
impl Copy for Triangle
Source§impl<'de> Deserialize<'de> for Triangle
impl<'de> Deserialize<'de> for Triangle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for Triangle
impl JsonSchema for Triangle
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl Shape for Triangle
impl Shape for Triangle
Source§type PathElementsIter<'iter> = TrianglePathIter
type PathElementsIter<'iter> = TrianglePathIter
The iterator returned by the
path_elements method.Source§fn path_elements(&self, _tolerance: f64) -> TrianglePathIter
fn path_elements(&self, _tolerance: f64) -> TrianglePathIter
Source§fn bounding_box(&self) -> Rect
fn bounding_box(&self) -> Rect
The smallest rectangle that encloses the shape.
Source§fn into_path(self, tolerance: f64) -> BezPathwhere
Self: Sized,
fn into_path(self, tolerance: f64) -> BezPathwhere
Self: Sized,
Convert into a Bézier path. Read more
Source§fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
Source§fn as_rounded_rect(&self) -> Option<RoundedRect>
fn as_rounded_rect(&self) -> Option<RoundedRect>
If the shape is a rounded rectangle, make it available.
impl StructuralPartialEq for Triangle
Auto Trait Implementations§
impl Freeze for Triangle
impl RefUnwindSafe for Triangle
impl Send for Triangle
impl Sync for Triangle
impl Unpin for Triangle
impl UnsafeUnpin for Triangle
impl UnwindSafe for Triangle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more