unit-conversions 0.1.16

Various units of measurement conversions
Documentation
// <auto-generated>
// This code was generated by the UnitCodeGenerator tool
//
// Changes to this file will be lost if the code is regenerated
// </auto-generated>

//! # Angle based converters

/// Degrees conversion functions
pub mod degrees {
	/// Converts the supplied Degrees value to Radians
	/// # Arguments
	/// * `value` - The Degrees input value
	pub fn to_radians(value: f64) -> f64 {
		return value * std::f64::consts::PI/180.0;
	}
	/// Converts the supplied Degrees value to Gradians
	/// # Arguments
	/// * `value` - The Degrees input value
	pub fn to_gradians(value: f64) -> f64 {
		return value * 200.0/180.0;
	}
	/// Converts the supplied Degrees value to Milliradians
	/// # Arguments
	/// * `value` - The Degrees input value
	pub fn to_milliradians(value: f64) -> f64 {
		return value * (1000.0 * std::f64::consts::PI)/180.0;
	}
	/// Converts the supplied Degrees value to Minute Of Arc
	/// # Arguments
	/// * `value` - The Degrees input value
	pub fn to_minute_of_arc(value: f64) -> f64 {
		return value * 60.0;
	}
	/// Converts the supplied Degrees value to Seconds Of Arc
	/// # Arguments
	/// * `value` - The Degrees input value
	pub fn to_seconds_of_arc(value: f64) -> f64 {
		return value * 3600.0;
	}
}
/// Gradians conversion functions
pub mod gradians {
	/// Converts the supplied Gradians value to Degrees
	/// # Arguments
	/// * `value` - The Gradians input value
	pub fn to_degrees(value: f64) -> f64 {
		return value * 180.0/200.0;
	}
	/// Converts the supplied Gradians value to Radians
	/// # Arguments
	/// * `value` - The Gradians input value
	pub fn to_radians(value: f64) -> f64 {
		return value * std::f64::consts::PI/200.0;
	}
	/// Converts the supplied Gradians value to Milliradians
	/// # Arguments
	/// * `value` - The Gradians input value
	pub fn to_milliradians(value: f64) -> f64 {
		return value * (1000.0*std::f64::consts::PI)/200.0;
	}
	/// Converts the supplied Gradians value to Minute Of Arc
	/// # Arguments
	/// * `value` - The Gradians input value
	pub fn to_minute_of_arc(value: f64) -> f64 {
		return value * 54.0;
	}
	/// Converts the supplied Gradians value to Seconds Of Arc
	/// # Arguments
	/// * `value` - The Gradians input value
	pub fn to_seconds_of_arc(value: f64) -> f64 {
		return value * 3240.0;
	}
}
/// Milliradians conversion functions
pub mod milliradians {
	/// Converts the supplied Milliradians value to Degrees
	/// # Arguments
	/// * `value` - The Milliradians input value
	pub fn to_degrees(value: f64) -> f64 {
		return value * 180.0/(1000.0 * std::f64::consts::PI);
	}
	/// Converts the supplied Milliradians value to Radians
	/// # Arguments
	/// * `value` - The Milliradians input value
	pub fn to_radians(value: f64) -> f64 {
		return value / 1000.0;
	}
	/// Converts the supplied Milliradians value to Gradians
	/// # Arguments
	/// * `value` - The Milliradians input value
	pub fn to_gradians(value: f64) -> f64 {
		return value * 200.0/(1000.0 * std::f64::consts::PI);
	}
	/// Converts the supplied Milliradians value to Minute Of Arc
	/// # Arguments
	/// * `value` - The Milliradians input value
	pub fn to_minute_of_arc(value: f64) -> f64 {
		return value * (60.0 * 180.0)/(1000.0 * std::f64::consts::PI);
	}
	/// Converts the supplied Milliradians value to Seconds Of Arc
	/// # Arguments
	/// * `value` - The Milliradians input value
	pub fn to_seconds_of_arc(value: f64) -> f64 {
		return value * (3600.0 * 180.0)/(1000.0 * std::f64::consts::PI);
	}
}
/// Minute Of Arc conversion functions
pub mod minute_of_arc {
	/// Converts the supplied Minute Of Arc value to Degrees
	/// # Arguments
	/// * `value` - The Minute Of Arc input value
	pub fn to_degrees(value: f64) -> f64 {
		return value / 60.0;
	}
	/// Converts the supplied Minute Of Arc value to Radians
	/// # Arguments
	/// * `value` - The Minute Of Arc input value
	pub fn to_radians(value: f64) -> f64 {
		return value * std::f64::consts::PI/(60.0 * 180.0);
	}
	/// Converts the supplied Minute Of Arc value to Gradians
	/// # Arguments
	/// * `value` - The Minute Of Arc input value
	pub fn to_gradians(value: f64) -> f64 {
		return value / 54.0;
	}
	/// Converts the supplied Minute Of Arc value to Milliradians
	/// # Arguments
	/// * `value` - The Minute Of Arc input value
	pub fn to_milliradians(value: f64) -> f64 {
		return value * (1000.0 * std::f64::consts::PI) / (60.0 * 180.0);
	}
	/// Converts the supplied Minute Of Arc value to Seconds Of Arc
	/// # Arguments
	/// * `value` - The Minute Of Arc input value
	pub fn to_seconds_of_arc(value: f64) -> f64 {
		return value * 60.0;
	}
}
/// Radians conversion functions
pub mod radians {
	/// Converts the supplied Radians value to Degrees
	/// # Arguments
	/// * `value` - The Radians input value
	pub fn to_degrees(value: f64) -> f64 {
		return value * 180.0/std::f64::consts::PI;
	}
	/// Converts the supplied Radians value to Gradians
	/// # Arguments
	/// * `value` - The Radians input value
	pub fn to_gradians(value: f64) -> f64 {
		return value * 200.0/std::f64::consts::PI;
	}
	/// Converts the supplied Radians value to Milliradians
	/// # Arguments
	/// * `value` - The Radians input value
	pub fn to_milliradians(value: f64) -> f64 {
		return value * 1000.0;
	}
	/// Converts the supplied Radians value to Minute Of Arc
	/// # Arguments
	/// * `value` - The Radians input value
	pub fn to_minute_of_arc(value: f64) -> f64 {
		return value * (60.0 * 180.0)/std::f64::consts::PI;
	}
	/// Converts the supplied Radians value to Seconds Of Arc
	/// # Arguments
	/// * `value` - The Radians input value
	pub fn to_seconds_of_arc(value: f64) -> f64 {
		return value * (3600.0 * 180.0)/std::f64::consts::PI;
	}
}
/// Seconds Of Arc conversion functions
pub mod seconds_of_arc {
	/// Converts the supplied Seconds Of Arc value to Degrees
	/// # Arguments
	/// * `value` - The Seconds Of Arc input value
	pub fn to_degrees(value: f64) -> f64 {
		return value / 3600.0;
	}
	/// Converts the supplied Seconds Of Arc value to Radians
	/// # Arguments
	/// * `value` - The Seconds Of Arc input value
	pub fn to_radians(value: f64) -> f64 {
		return value * std::f64::consts::PI/(180.0 * 3600.0);
	}
	/// Converts the supplied Seconds Of Arc value to Gradians
	/// # Arguments
	/// * `value` - The Seconds Of Arc input value
	pub fn to_gradians(value: f64) -> f64 {
		return value / 3240.0;
	}
	/// Converts the supplied Seconds Of Arc value to Milliradians
	/// # Arguments
	/// * `value` - The Seconds Of Arc input value
	pub fn to_milliradians(value: f64) -> f64 {
		return value * (1000.0 * std::f64::consts::PI) / (180.0 * 3600.0);
	}
	/// Converts the supplied Seconds Of Arc value to Minute Of Arc
	/// # Arguments
	/// * `value` - The Seconds Of Arc input value
	pub fn to_minute_of_arc(value: f64) -> f64 {
		return value / 60.0;
	}
}