Generates a random point in or on a unit-radius sphere centred on the origin. More...
#include <xyz.h>
Public Member Functions | |
RandomXYZInSphere (Random01 &rng, float radius) | |
![]() | |
XYZ () | |
Null constructor. More... | |
XYZ (const XYZ &v) | |
Copy constructor. | |
XYZ (float vx, float vy, float vz) | |
Initialise from separate components. | |
~XYZ () | |
Destructor. | |
const float & | element (uint e) const |
Access by number. | |
float & | element (uint e) |
Access by number. | |
void | operator*= (float k) |
Multiply by scalar. | |
void | operator/= (float k) |
Divide by scalar. More... | |
void | operator+= (const XYZ &v) |
Vector addition. | |
void | operator-= (const XYZ &v) |
Vector subtraction. | |
void | assign (const XYZ &v) |
Assignment. | |
const XYZ | operator- () const |
Negation. | |
float | magnitude2 () const |
Return the square of the magnitude. | |
float | magnitude () const |
Return the magnitude. | |
const XYZ | normalised () const |
Return the vector normalised. More... | |
void | normalise () |
Normalise this vector. More... | |
std::ostream & | write (std::ostream &) const |
Write the vector (spaces as separators). | |
const std::string | format_comma () const |
Alternate formatting. | |
const std::string | format_blender () const |
Alternate formatting. | |
const std::string | format_pov () const |
Alternate formatting. More... | |
Additional Inherited Members | |
![]() | |
typedef float XYZ::* | ElementPtr |
![]() | |
float | x |
float | y |
float | z |
![]() | |
static ElementPtr | element_table [3] ={&XYZ::x,&XYZ::y,&XYZ::z} |
Generates a random point in or on a unit-radius sphere centred on the origin.