Euphoria
polarcoord.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "base/angle.h"
4 #include "base/vec3.h"
5 
6 namespace eu
7 {
8  struct Random;
9 
10  // source: http://mathworld.wolfram.com/SphericalCoordinates.html
12  {
13  Angle azimuthal; // longitude, 0-2pi
14  Angle polar; // zenith, colatitude, 0-pi
15 
16  PolarCoordinate(float azimuthal01, float polar01);
17 
18  [[nodiscard]] static PolarCoordinate create_random(::eu::Random* random);
19 
20  [[nodiscard]] unit3f to_unit_vector() const;
21  };
22 
24 
25 }
Definition: assert.h:90
unit3f get_random_unit3(Random *random)
Definition: polarcoord.cc:42
PolarCoordinate(float azimuthal01, float polar01)
Definition: polarcoord.cc:10
static PolarCoordinate create_random(::eu::Random *random)
Definition: polarcoord.cc:34
unit3f to_unit_vector() const
Definition: polarcoord.cc:19
WEL512 Random Number Generator.
Definition: random.h:21