~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to src/kernel/grid/Point.cpp

  • Committer: logg
  • Date: 2003-02-06 14:40:25 UTC
  • Revision ID: devnull@localhost-20030206144025-bmqurqq95f073l40
Tailorized "2003-02-06 08:40:24 by logg"
Fixes...

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#include <dolfin/Point.h>
3
3
 
4
4
//-----------------------------------------------------------------------------
5
 
real Point::Distance(Point p)
6
 
{
7
 
  real dx = real(x) - real(p.x);
8
 
  real dy = real(y) - real(p.y);
9
 
  real dz = real(z) - real(p.z);
 
5
Point::Point()
 
6
{
 
7
  x = 0.0;
 
8
  y = 0.0;
 
9
  z = 0.0;
 
10
}
 
11
//-----------------------------------------------------------------------------
 
12
Point::Point(real x)
 
13
{
 
14
  this->x = x;
 
15
  y = 0.0;
 
16
  z = 0.0;
 
17
}
 
18
//-----------------------------------------------------------------------------
 
19
Point::Point(real x, real y)
 
20
{
 
21
  this->x = x;
 
22
  this->y = y;
 
23
  z = 0.0;
 
24
}
 
25
//-----------------------------------------------------------------------------
 
26
Point::Point(real x, real y, real z)
 
27
{
 
28
  this->x = x;
 
29
  this->y = y;
 
30
  this->z = z;
 
31
}
 
32
//-----------------------------------------------------------------------------
 
33
real Point::dist(Point p)
 
34
{
 
35
  real dx = x - p.x;
 
36
  real dy = y - p.y;
 
37
  real dz = z - p.z;
10
38
 
11
 
  return ( sqrt(dx*dx+dy*dy+dz*dz) );
 
39
  return sqrt( dx*dx + dy*dy + dz*dz );
12
40
}
13
41
//-----------------------------------------------------------------------------