RobinTrace
Typedefs | Functions
Vec3.h File Reference
#include <cmath>
#include <iostream>
#include <Eigen/Dense>
Include dependency graph for Vec3.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef Eigen::Vector3d Vec3
 

Functions

Vec3 Vec3_lm (double l, double m, bool nsign)
 Constructor of a unit Vec3 from direction cosines (l, m) and the sign of n. More...
 
std::ostream & operator<< (std::ostream &out, const Vec3 &v)
 Vec3 printer.
 

Typedef Documentation

◆ Vec3

typedef Eigen::Vector3d Vec3

A 3D vector.

Function Documentation

◆ Vec3_lm()

Vec3 Vec3_lm ( double  l,
double  m,
bool  nsign 
)

Constructor of a unit Vec3 from direction cosines (l, m) and the sign of n.

Parameters
lDirection cosine in the x direction.
mDirection cosine in the y direction.
nsignSign of the direction cosine in the z direction. True for positive, False for negative.

The component n is built automatically from (l, m) and the specified sign so as to obtain a unit vector.

When nsign is True,

\[ n = \sqrt{1 - l^2 - m^2} \]

When nsign is False,

\[ n = - \sqrt{1 - l^2 - m^2} \]