mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
* Added "Dist" and "Dist2" functions to the Vec3d class
This commit is contained in:
parent
87e74276f3
commit
dd5ae2c395
@ -255,6 +255,17 @@ public:
|
|||||||
double Length2() const
|
double Length2() const
|
||||||
{ return x[0] * x[0] + x[1] * x[1] + x[2] * x[2]; }
|
{ return x[0] * x[0] + x[1] * x[1] + x[2] * x[2]; }
|
||||||
|
|
||||||
|
///
|
||||||
|
inline friend double Dist (const Vec3d & v1, const Vec3d & v2)
|
||||||
|
{ return sqrt ( (v1.x[0]-v2.x[0]) * (v1.x[0]-v2.x[0]) +
|
||||||
|
(v1.x[1]-v2.x[1]) * (v1.x[1]-v2.x[1]) +
|
||||||
|
(v1.x[2]-v2.x[2]) * (v1.x[2]-v2.x[2])); }
|
||||||
|
///
|
||||||
|
inline friend double Dist2 (const Vec3d & v1, const Vec3d & v2)
|
||||||
|
{ return ( (v1.x[0]-v2.x[0]) * (v1.x[0]-v2.x[0]) +
|
||||||
|
(v1.x[1]-v2.x[1]) * (v1.x[1]-v2.x[1]) +
|
||||||
|
(v1.x[2]-v2.x[2]) * (v1.x[2]-v2.x[2])); }
|
||||||
|
|
||||||
///
|
///
|
||||||
Vec3d & operator+= (const Vec3d & v2);
|
Vec3d & operator+= (const Vec3d & v2);
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user