source: git/src/vector3.h @ 864dab8

RELEASE/1.0RELEASE/1.1RELEASE/1.2debug-cidebug-ci-sanitisersfaster-cavernloglog-selectstereostereo-2025walls-datawalls-data-hanging-as-warningwarn-only-for-hanging-survey
Last change on this file since 864dab8 was 5809313, checked in by Olly Betts <olly@…>, 24 years ago

Mark's new wxwindows version of aven

git-svn-id: file:///home/survex-svn/survex/trunk@624 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

  • Property mode set to 100644
File size: 1.6 KB
Line 
1//
2//  vector3.h
3//
4//  C++ class for 3-element vectors
5//
6//  Copyright (C) 2000-2001, Mark R. Shinwell.
7//
8//  This program is free software; you can redistribute it and/or modify
9//  it under the terms of the GNU General Public License as published by
10//  the Free Software Foundation; either version 2 of the License, or
11//  (at your option) any later version.
12//
13//  This program is distributed in the hope that it will be useful,
14//  but WITHOUT ANY WARRANTY; without even the implied warranty of
15//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16//  GNU General Public License for more details.
17//
18//  You should have received a copy of the GNU General Public License
19//  along with this program; if not, write to the Free Software
20//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21//
22
23#ifndef Vector3_h
24#define Vector3_h
25
26class Vector3 {
27    double x;
28    double y;
29    double z;
30
31public:
32    Vector3();
33    Vector3(double, double, double);
34    ~Vector3();
35
36    double getX() { return x; }
37    double getY() { return y; }
38    double getZ() { return z; }
39
40    double magnitude();
41    void normalise();
42
43    void set(double, double, double);
44
45    Vector3& operator*=(const double);
46    Vector3& operator/=(const double);
47    Vector3& operator=(const Vector3&);
48
49    friend Vector3 operator*(const Vector3&, const double);
50    friend Vector3 operator*(const double, const Vector3&);
51    friend Vector3 operator*(const Vector3&, const Vector3&);
52    friend Vector3 operator+(const Vector3&, const Vector3&);
53    friend double dot(const Vector3&, const Vector3&);
54};
55
56#endif
Note: See TracBrowser for help on using the repository browser.