[−][src]Struct polys::Tri
Struct that represents a triangle.
Fields
side1: f64side2: f64side3: f64Implementations
impl Tri[src]
pub fn new(s1: f64, s2: f64, s3: f64) -> Tri[src]
Returns a new Tri from given sides s1, s2, s3.
Examples
let tri = polys::Tri::new(24.0, 30.0, 18.0);
Trait Implementations
impl Debug for Tri[src]
impl Polygon for Tri[src]
fn area(&self) -> f64[src]
Gets the area of the Tri from its sides.
Examples
let tri = polys::Tri::new(24.0, 30.0, 18.0); let area = tri.area(); assert_eq!(area, 216 as f64);
fn peri(&self) -> f64[src]
Gets the perimeter of the Tri from its sides.
Examples
let tri = polys::Tri::new(24.0, 30.0, 18.0); let peri = tri.peri(); assert_eq!(peri, 72f64);
Auto Trait Implementations
impl RefUnwindSafe for Tri
impl Send for Tri
impl Sync for Tri
impl Unpin for Tri
impl UnwindSafe for Tri
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,