Am 01.12.2026 um 18:48 schrieb bartc:
> I had the option to use either ° or 'deg':
>
> 15 deg
How about that ?
#include <iostream>
#include <complex>
#include <cmath>
using namespace std;
struct degree {};
complex<double> operator *( double angle, degree )
{
return complex<double>( sin( angle ), cos( angle ) );
}
int main()
{
constexpr double Pi4 = 3.1415926535897932384626433832795 / 4.0;
complex<double> dPi4 = Pi4 * degree();
cout << abs( dPi4 ) << endl;
}