Struct plutchik::Wheel
[−]
[src]
pub struct Wheel { pub radians: f32, pub weight: f32, }
Representation of an emotion in the form of a Plutchik Wheel. Useful for emotional tagging and aesthetic comparisons.
Fields
radians: f32
weight: f32
Methods
impl Wheel
[src]
fn mean<T>(emotions: &[T]) -> Wheel where
T: Deref<Target = Wheel>,
T: Deref<Target = Wheel>,
Construct the mean (average) emotion wheel given a number of other emotions.
fn difference(&self, other: &Wheel) -> f32
Compare two Wheels and return the result as a difference weight where 0 is the minimum distance and 1 is the maximum. Determine the difference as the magnitude of the vector that separates both points on the wheel.
fn closest_emotion(&self) -> Emotion
Return the closest matching Emotion
variant to the current state of the Wheel.
fn closest_emotions(&self, n: usize) -> Vec<Emotion>
Return the closest n
number of emotions to the current state of the wheel.
fn opposite(&self) -> Wheel
Return the wheel's opposite.
Trait Implementations
impl Copy for Wheel
[src]
impl Clone for Wheel
[src]
fn clone(&self) -> Wheel
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Wheel
[src]
impl PartialEq for Wheel
[src]
fn eq(&self, __arg_0: &Wheel) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Wheel) -> bool
This method tests for !=
.
impl Rand for Wheel
[src]
fn rand<R: Rng>(rng: &mut R) -> Wheel
Generates a random instance of this type using the specified source of randomness. Read more