26#ifndef WFMATH_ROT_BOX_FUNCS_H
27#define WFMATH_ROT_BOX_FUNCS_H
29#include <wfmath/rotbox.h>
31#include <wfmath/vector.h>
32#include <wfmath/point.h>
33#include <wfmath/axisbox.h>
34#include <wfmath/ball.h>
41inline Point<dim> RotBox<dim>::getCorner(
size_t i)
const
43 assert(i >= 0 && i < (1 << dim));
50 for(
int j = 0; j < dim; ++j)
51 dist[j] = (i & (1 << j)) ? m_size[j] : 0;
55 return m_corner0 +
Prod(dist, m_orient);
81 for(
int i = 0; i < dim; ++i) {
82 for(
int j = 0; j < dim; ++j) {
83 CoordType value = m_orient.elem(j, i) * m_size[j];
91 bool valid = isValid();
105 return coords.corner0() + (*
this -
Point().
setToOrigin()) * coords.orientation();
111 return Point().
setToOrigin() + coords.orientation() * (*
this - coords.corner0());
A dim dimensional axis-aligned box.
Definition axisbox.h:63
A dim dimensional point.
Definition point.h:96
Point & setToOrigin()
Set point to (0,0,...,0).
Definition point_funcs.h:64
A dim dimensional box, lying at an arbitrary angle.
Definition rotbox.h:47
A dim dimensional vector.
Definition vector.h:121
void setValid(bool valid=true)
make isValid() return true if you've initialized the vector by hand
Definition vector.h:154
Generic library namespace.
Definition atlasconv.h:45
RotMatrix< dim > Prod(const RotMatrix< dim > &m1, const RotMatrix< dim > &m2)
returns m1 * m2
Definition rotmatrix_funcs.h:89
float CoordType
Basic floating point type.
Definition const.h:140