Skip to main content

nominal_api_conjure/conjure/objects/scout/compute/api/
atan2.rs

1/// Computes the two-argument arctangent atan2(y, x) using signs to determine the quadrant.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    conjure_object::private::DeriveWith,
8    conjure_object::log_safety::derive::LogSafe
9)]
10#[serde(crate = "conjure_object::serde")]
11#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
12#[conjure_object::private::staged_builder::staged_builder]
13#[builder(crate = conjure_object::private::staged_builder, update, inline)]
14pub struct Atan2 {
15    #[builder(custom(type = super::NumericSeries, convert = Box::new))]
16    #[serde(rename = "y")]
17    #[assert_is_safe]
18    y: Box<super::NumericSeries>,
19    #[builder(custom(type = super::NumericSeries, convert = Box::new))]
20    #[serde(rename = "x")]
21    #[assert_is_safe]
22    x: Box<super::NumericSeries>,
23}
24impl Atan2 {
25    /// Constructs a new instance of the type.
26    #[inline]
27    pub fn new(y: super::NumericSeries, x: super::NumericSeries) -> Self {
28        Self::builder().y(y).x(x).build()
29    }
30    /// Y-coordinate series.
31    #[inline]
32    pub fn y(&self) -> &super::NumericSeries {
33        &*self.y
34    }
35    /// X-coordinate series.
36    #[inline]
37    pub fn x(&self) -> &super::NumericSeries {
38        &*self.x
39    }
40}