QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
analysis
interpolation
Vector3D.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
Vector3D.cpp
3
------------
4
copyright : (C) 2004 by Marco Hugentobler
5
email : mhugent@geo.unizh.ch
6
***************************************************************************/
7
8
/***************************************************************************
9
* *
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
14
* *
15
***************************************************************************/
16
17
#include "
Vector3D.h
"
18
19
double
Vector3D::getLength
()
const
20
{
21
return
sqrt(
getX
() *
getX
() +
getY
() *
getY
() +
getZ
() *
getZ
() );
22
}
23
24
void
Vector3D::standardise
()
25
{
26
const
double
length =
getLength
();
27
setX
(
getX
() / length );
28
setY
(
getY
() / length );
29
setZ
(
getZ
() / length );
30
}
31
32
bool
Vector3D::operator==
(
const
Vector3D
&v )
const
33
{
34
return
(
mX
== v.
getX
() &&
mY
== v.
getY
() &&
mZ
== v.
getZ
() );
35
}
36
37
bool
Vector3D::operator!=
(
const
Vector3D
&v )
const
38
{
39
return
( !( ( *
this
) == v ) );
40
}
Vector3D.h
Vector3D::operator!=
bool operator!=(const Vector3D &v) const
Definition
Vector3D.cpp:37
Vector3D::standardise
void standardise()
Standardises the vector.
Definition
Vector3D.cpp:24
Vector3D::mX
double mX
X-component of the vector.
Definition
Vector3D.h:40
Vector3D::setX
void setX(double x)
Sets the x-component of the vector.
Definition
Vector3D.h:105
Vector3D::operator==
bool operator==(const Vector3D &v) const
Definition
Vector3D.cpp:32
Vector3D::getY
double getY() const
Returns the y-component of the vector.
Definition
Vector3D.h:95
Vector3D::mZ
double mZ
Z-component of the vector.
Definition
Vector3D.h:44
Vector3D::getX
double getX() const
Returns the x-component of the vector.
Definition
Vector3D.h:90
Vector3D::setY
void setY(double y)
Sets the y-component of the vector.
Definition
Vector3D.h:110
Vector3D::getZ
double getZ() const
Returns the z-component of the vector.
Definition
Vector3D.h:100
Vector3D::getLength
double getLength() const
Returns the length of the vector.
Definition
Vector3D.cpp:19
Vector3D::Vector3D
Vector3D(double x, double y, double z)
Constructor taking the three components as arguments.
Definition
Vector3D.h:82
Vector3D::mY
double mY
Y-component of the vector.
Definition
Vector3D.h:42
Vector3D::setZ
void setZ(double z)
Sets the z-component of the vector.
Definition
Vector3D.h:115
Generated on
for QGIS API Documentation by
1.17.0