LevelS C++ support library  3.82
Functions
geom_utils.h File Reference
#include <vector>
#include "math_utils.h"
#include "vec3.h"

Go to the source code of this file.

Functions

double orientation (const vec3 &loc, const vec3 &dir)
 
double v_angle (const vec3 &v1, const vec3 &v2)
 
double cosdist_zphi (double z1, double phi1, double z2, double phi2)
 
void find_enclosing_circle (const std::vector< vec3 > &point, vec3 &center, double &cosrad)
 

Detailed Description

Geometric utility functions.

Copyright (C) 2003-2016 Max-Planck-Society

Author
Martin Reinecke
Reinhard Hell

Definition in file geom_utils.h.

Function Documentation

◆ orientation()

double orientation ( const vec3 loc,
const vec3 dir 
)
inline

Returns the orientation when looking from point loc on the unit sphere in the direction dir. loc must be normalized. The result ranges from -pi to pi, is 0 for North and pi/2 for West, i.e. the angle is given in mathematically positive sense.

If loc is the North or South pole, the returned angle is atan2(dir.y,dir.x).

Definition at line 47 of file geom_utils.h.

◆ v_angle()

double v_angle ( const vec3 v1,
const vec3 v2 
)
inline

Returns the angle between v1 and v2 in radians.

Definition at line 58 of file geom_utils.h.

◆ cosdist_zphi()

double cosdist_zphi ( double  z1,
double  phi1,
double  z2,
double  phi2 
)
inline

Returns the cosine of the angle between the two points on the sphere defined by (z1, phi1) and (z2, phi2), respectively. z is the cosine of the colatitude, and phi is the longitude.

Definition at line 67 of file geom_utils.h.

◆ find_enclosing_circle()

void find_enclosing_circle ( const std::vector< vec3 > &  point,
vec3 center,
double &  cosrad 
)

Finds the smallest enclosing cone for a point set on the sphere according to Barequet & Elber: Information Processing Letters 93(2005), p.83. All points are expected to be passed as unit vectors. The enclosing cone must have an opening angle <pi/2.


Generated on Thu Jul 28 2022 17:32:06 for LevelS C++ support library