Flutter Engine
 
Loading...
Searching...
No Matches
impeller::Degrees Struct Reference

#include <scalar.h>

Public Member Functions

constexpr Degrees ()=default
 
constexpr Degrees (Scalar p_degrees)
 
constexpr operator Radians () const
 
constexpr bool IsFinite () const
 
constexpr Degrees operator- () const
 
constexpr Degrees operator+ (Degrees d) const
 
constexpr Degrees operator- (Degrees d) const
 
constexpr auto operator<=> (const Degrees &d) const =default
 
constexpr Degrees GetPositive () const
 

Public Attributes

Scalar degrees = 0.0
 

Detailed Description

Definition at line 66 of file scalar.h.

Constructor & Destructor Documentation

◆ Degrees() [1/2]

constexpr impeller::Degrees::Degrees ( )
constexprdefault

◆ Degrees() [2/2]

constexpr impeller::Degrees::Degrees ( Scalar  p_degrees)
inlineexplicitconstexpr

Definition at line 71 of file scalar.h.

71: degrees(p_degrees) {}
Scalar degrees
Definition scalar.h:67

Member Function Documentation

◆ GetPositive()

constexpr Degrees impeller::Degrees::GetPositive ( ) const
inlineconstexpr

Definition at line 91 of file scalar.h.

91 {
92 Scalar deg = std::fmod(degrees, 360.0f);
93 if (deg < 0.0f) {
94 deg += 360.0f;
95 }
96 return Degrees{deg};
97 }
float Scalar
Definition scalar.h:19
constexpr Degrees()=default

References degrees.

Referenced by impeller::Arc::ComputeIterations(), and impeller::Arc::GetTightArcBounds().

◆ IsFinite()

constexpr bool impeller::Degrees::IsFinite ( ) const
inlineconstexpr

Definition at line 77 of file scalar.h.

77{ return std::isfinite(degrees); }

References degrees.

Referenced by impeller::Arc::Arc().

◆ operator Radians()

constexpr impeller::Degrees::operator Radians ( ) const
inlineconstexpr

Definition at line 73 of file scalar.h.

73 {
74 return Radians{degrees * kPi / 180.0f};
75 };
constexpr float kPi
Definition constants.h:26

References degrees, and impeller::kPi.

◆ operator+()

constexpr Degrees impeller::Degrees::operator+ ( Degrees  d) const
inlineconstexpr

Definition at line 81 of file scalar.h.

81 {
82 return Degrees{degrees + d.degrees};
83 }
auto & d
Definition main.cc:28

References d, and degrees.

◆ operator-() [1/2]

constexpr Degrees impeller::Degrees::operator- ( ) const
inlineconstexpr

Definition at line 79 of file scalar.h.

79{ return Degrees{-degrees}; }

References degrees.

◆ operator-() [2/2]

constexpr Degrees impeller::Degrees::operator- ( Degrees  d) const
inlineconstexpr

Definition at line 85 of file scalar.h.

85 {
86 return Degrees{degrees - d.degrees};
87 }

References d, and degrees.

◆ operator<=>()

constexpr auto impeller::Degrees::operator<=> ( const Degrees d) const
constexprdefault

Member Data Documentation

◆ degrees


The documentation for this struct was generated from the following file: