Rename cross(v,v) to ort(v...), cross left as convenience
This commit is contained in:
parent
6844a01a8f
commit
007fd12240
1 changed files with 14 additions and 1 deletions
|
|
@ -233,8 +233,15 @@ namespace psemek::geom
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: generic implementation (shares internals with det)
|
||||||
template <typename T>
|
template <typename T>
|
||||||
vector<T, 3> cross(vector<T, 3> const & v0, vector<T, 3> const & v1)
|
vector<T, 2> ort(vector<T, 2> const & v0)
|
||||||
|
{
|
||||||
|
return {-v0[1], v0[0]};
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
vector<T, 3> ort(vector<T, 3> const & v0, vector<T, 3> const & v1)
|
||||||
{
|
{
|
||||||
return vector<T, 3>{
|
return vector<T, 3>{
|
||||||
v0[1] * v1[2] - v0[2] * v1[1],
|
v0[1] * v1[2] - v0[2] * v1[1],
|
||||||
|
|
@ -243,6 +250,12 @@ namespace psemek::geom
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
vector<T, 3> cross(vector<T, 3> const & v0, vector<T, 3> const & v1)
|
||||||
|
{
|
||||||
|
return ort(v0, v1);
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T lerp(T const & x0, T const & x1, T const & t)
|
T lerp(T const & x0, T const & x1, T const & t)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue