PolarScaler
struct · ferroui-livecharts · v0.5.0
struct PolarScaler
Members
centermin_radiusmax_radiusmin_anglemax_angleinner_radiusnewget_angleto_pixelsto_pixels_with_angle_in_degreesto_chart_values
center
center: ferroui_base::Point
min_radius
min_radius: f64
max_radius
max_radius: f64
min_angle
min_angle: f64
max_angle
max_angle: f64
inner_radius
inner_radius: f64
new
fn new(plot: Rect, options: PolarScaleOptions) -> Result<Self, ScaleError>
get_angle
fn get_angle(self: Self, angle: f64) -> f64
Source-compatible angle convention: angle values are measured from zero; the bounds set the angular interval length, not its angular origin.
to_pixels
fn to_pixels(self: Self, angle: f64, radius: f64) -> Point
to_pixels_with_angle_in_degrees
fn to_pixels_with_angle_in_degrees(self: Self, angle: f64, radius: f64) -> Point
to_chart_values
fn to_chart_values(self: Self, point: Point) -> Point
Inverse of to_pixels, using atan2 so axes and every quadrant work.
Values are normalized to one revolution starting at the initial rotation.
This corrects the upstream inverse's division by zero and extra MinAngle.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedPropertyValueAnyValueClassDefaultsErasedDestructorIntoEitherCloneCopyDebugStructuralPartialEqPartialEq
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.