19 #ifndef vsr_simplex_INC
20 #define vsr_simplex_INC
33 Edge(
int _a,
int _b) : a(_a), b(_b){}
39 Face(
int _a,
int _b,
int _c) : a(_a), b(_b), c(_c) {}
80 using B = NE<>::template e<N+1>;
81 using SubRot = decltype( doBary().unit() * B() );
83 i = i.sp( SubRot(rot) );
90 Vec tvec; tvec[N-1] = 1;
91 auto nrot =
Gen::ratio( verts.back().unit(), tvec );
92 using B2 = NE<>::template e<N>;
93 using SubRot2 = decltype( verts.back().unit() * B2() );
96 i = i.sp( SubRot2(nrot) );
104 for (
int i=0;i<N+1;++i){
107 roots.push_back( t );
109 for (
int j=i+1;j<N+1;++j){
110 edges.push_back( Edge(i,j) );
112 bool bSwitch =
false;
113 for (
int k=j+1;k<N+1;++k){
114 faces.push_back( bSwitch ? Face(i, j, k) : Face(i, k, j) );
126 Biv biv(
int which,
float amt = 1.0) {
127 return (verts[N] ^ verts[
int(which)%N]) * amt;
130 void spin(
const Biv& biv){
131 for (
auto& i : verts){
136 void spin(
int which,
float amt = 1.0){
137 spin( biv(which,amt) );
140 vector<NEVec<3>> project (
float dist,
bool bOrtho=
false)
const{
141 vector< NEVec<3> > proj;
142 for (
auto i : verts){
143 auto tmp = Proj<N>::Call(dist, i);
144 NEVec<3> tmp2 = NEVec<3>(i);
145 proj.push_back( bOrtho ? tmp2 : tmp );
Definition: vsr_simplex.h:29
Generic Geometric Number Types (templated on an algebra and a basis )
Definition: vsr_algebra.h:69
static Rot rot(const Biv &b)
vsr::cga::Rotor from vsr::cga::Bivector
Definition: vsr_simplex.h:37
Definition: vsr_simplex.h:31
static Rot ratio(const Vec &v, const Vec &v2)
vsr::cga::Rotor that takes one vec to another
the versor library namespace
Definition: vsr_algebra.h:29