My Project
 All Classes Files Functions Variables Enumerations Pages
Public Member Functions | List of all members
RandomXYZInSphere Class Reference

Generates a random point in or on a unit-radius sphere centred on the origin. More...

#include <xyz.h>

Inheritance diagram for RandomXYZInSphere:
XYZ

Public Member Functions

 RandomXYZInSphere (Random01 &rng, float radius)
 
- Public Member Functions inherited from XYZ
 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

- Public Types inherited from XYZ
typedef float XYZ::* ElementPtr
 
- Public Attributes inherited from XYZ
float x
 
float y
 
float z
 
- Static Public Attributes inherited from XYZ
static ElementPtr element_table [3] ={&XYZ::x,&XYZ::y,&XYZ::z}
 

Detailed Description

Generates a random point in or on a unit-radius sphere centred on the origin.


The documentation for this class was generated from the following files: