mirror of
https://github.com/thestk/stk
synced 2026-01-15 14:01:52 +00:00
Version 4.1
This commit is contained in:
committed by
Stephen Sinclair
parent
81475b04c5
commit
2f09fcd019
53
include/Vector3D.h
Normal file
53
include/Vector3D.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/***************************************************/
|
||||
/*! \class Vector3D
|
||||
\brief STK 3D vector class.
|
||||
|
||||
This class implements a three-dimensional vector.
|
||||
|
||||
by Perry R. Cook, 1995 - 2002.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
#if !defined(__VECTOR3D_H)
|
||||
#define __VECTOR3D_H
|
||||
|
||||
class Vector3D {
|
||||
|
||||
public:
|
||||
//! Default constructor taking optional initial X, Y, and Z values.
|
||||
Vector3D(double initX=0.0, double initY=0.0, double initZ=0.0);
|
||||
|
||||
//! Class destructor.
|
||||
~Vector3D();
|
||||
|
||||
//! Get the current X value.
|
||||
double getX();
|
||||
|
||||
//! Get the current Y value.
|
||||
double getY();
|
||||
|
||||
//! Get the current Z value.
|
||||
double getZ();
|
||||
|
||||
//! Calculate the vector length.
|
||||
double getLength();
|
||||
|
||||
//! Set the X, Y, and Z values simultaniously.
|
||||
void setXYZ(double anX, double aY, double aZ);
|
||||
|
||||
//! Set the X value.
|
||||
void setX(double aval);
|
||||
|
||||
//! Set the Y value.
|
||||
void setY(double aval);
|
||||
|
||||
//! Set the Z value.
|
||||
void setZ(double aval);
|
||||
|
||||
protected:
|
||||
double myX;
|
||||
double myY;
|
||||
double myZ;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user