Mercurial > hg > orthanc-stl
comparison Sources/Vector3D.h @ 32:976da5476810
reorganization
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 04 Apr 2024 18:35:54 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
31:ab231760799d | 32:976da5476810 |
---|---|
1 /** | |
2 * SPDX-FileCopyrightText: 2023-2024 Sebastien Jodogne, UCLouvain, Belgium | |
3 * SPDX-License-Identifier: GPL-3.0-or-later | |
4 */ | |
5 | |
6 /** | |
7 * STL plugin for Orthanc | |
8 * Copyright (C) 2023-2024 Sebastien Jodogne, UCLouvain, Belgium | |
9 * | |
10 * This program is free software: you can redistribute it and/or | |
11 * modify it under the terms of the GNU General Public License as | |
12 * published by the Free Software Foundation, either version 3 of the | |
13 * License, or (at your option) any later version. | |
14 * | |
15 * This program is distributed in the hope that it will be useful, but | |
16 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
18 * General Public License for more details. | |
19 * | |
20 * You should have received a copy of the GNU General Public License | |
21 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
22 **/ | |
23 | |
24 | |
25 #pragma once | |
26 | |
27 | |
28 class Vector3D | |
29 { | |
30 private: | |
31 double x_; | |
32 double y_; | |
33 double z_; | |
34 | |
35 public: | |
36 Vector3D(); | |
37 | |
38 Vector3D(double x, | |
39 double y, | |
40 double z); | |
41 | |
42 Vector3D(const Vector3D& from, | |
43 const Vector3D& to); | |
44 | |
45 double GetX() const | |
46 { | |
47 return x_; | |
48 } | |
49 | |
50 double GetY() const | |
51 { | |
52 return y_; | |
53 } | |
54 | |
55 double GetZ() const | |
56 { | |
57 return z_; | |
58 } | |
59 | |
60 double ComputeSquaredNorm() const; | |
61 | |
62 double ComputeNorm() const; | |
63 | |
64 void Normalize(); | |
65 | |
66 static Vector3D CrossProduct(const Vector3D& u, | |
67 const Vector3D& v); | |
68 | |
69 static double DotProduct(const Vector3D& a, | |
70 const Vector3D& b); | |
71 | |
72 static bool AreParallel(const Vector3D& a, | |
73 const Vector3D& b); | |
74 }; |