1#ifndef _BBM_SPHERICAL_H_
2#define _BBM_SPHERICAL_H_
23 template<
typename T> T&
theta(vec2d<T>& v) {
return v[1]; }
24 template<
typename T>
const T&
theta(
const vec2d<T>& v) {
return v[1]; }
26 template<
typename T> T
theta(
const vec3d<T>& v)
30 auto temp = 2.0 * bbm::asin(0.5 * bbm::norm(diff));
39 template<
typename T> T&
phi(vec2d<T>& v) {
return v[0]; }
40 template<
typename T>
const T&
phi(
const vec2d<T>& v) {
return v[0]; }
42 template<
typename T> T
phi(
const vec3d<T>& v)
61 vec2d<T> cst = bbm::cossin(
theta(v));
62 vec2d<T> csp = bbm::cossin(
phi(v));
86 T
sinPhi(
const vec2d<T>& v) {
return bbm::sin(
phi(v)); }
118 T
cosPhi(
const vec2d<T>& v) {
return bbm::cos(
phi(v)); }
159 auto rsT = bbm::rcp(sT);
170 auto rsT2 = bbm::rcp(sT2);
189 T
tanPhi(
const vec2d<T>& v) {
return bbm::tan(
phi(v)); }
Defines additional helper methods for vectors.
T cosPhi2(const vec2d< T > &v)
Definition: spherical.h:128
vec2d< T > cossinTheta(const vec2d< T > &v)
Definition: spherical.h:141
T sinTheta(const vec2d< T > &v)
Definition: spherical.h:75
T & phi(vec2d< T > &v)
Definition: spherical.h:39
T tanTheta2(const vec2d< T > &v)
Definition: spherical.h:183
T sinTheta2(const vec2d< T > &v)
Definition: spherical.h:77
vec2d< T > cossinPhi2(const vec2d< T > &v)
Definition: spherical.h:164
vec2d< T > cossinPhi(const vec2d< T > &v)
Definition: spherical.h:153
T sinPhi2(const vec2d< T > &v)
Definition: spherical.h:96
T cosTheta(const vec2d< T > &v)
Definition: spherical.h:109
T tanTheta(const vec2d< T > &v)
Definition: spherical.h:177
T sinPhi(const vec2d< T > &v)
Definition: spherical.h:86
T cosPhi(const vec2d< T > &v)
Definition: spherical.h:118
T tanPhi(const vec2d< T > &v)
Definition: spherical.h:189
vec2d< T > convert(const vec3d< T > &v)
Definition: spherical.h:53
bbm::value_t< V > cosTheta2(const V &v)
Definition: spherical.h:115
T tanPhi2(const T &v)
Definition: spherical.h:195
T & theta(vec2d< T > &v)
Definition: spherical.h:23
vec2d< T > cossinTheta2(const vec2d< T > &v)
Definition: spherical.h:147
constexpr const vec3d< T > expand(const vec2d< T > &v, V &&a)
Definition: vec.h:55
constexpr decltype(auto) y(bbm::vec3d< T > &v)
Definition: vec.h:23
constexpr decltype(auto) z(bbm::vec3d< T > &v)
Definition: vec.h:26
constexpr decltype(auto) x(bbm::vec3d< T > &v)
Definition: vec.h:20
constexpr const vec2d< T > xy(const vec3d< T > &v)
Definition: vec.h:47
Definition: aggregatebsdf.h:29
constexpr auto select(MASK &&mask, const A &a, const A &b)
Definition: backbone.h:255
Definition: constants.h:17