-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpoint3.h
More file actions
37 lines (28 loc) · 1023 Bytes
/
point3.h
File metadata and controls
37 lines (28 loc) · 1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
#include <iostream>
#include "vector3.h"
namespace libMesh {
struct Point3 {
public:
Point3();
Point3(float x, float y, float z);
Point3(const Point3& other);
float x;
float y;
float z;
static Vector3 betweenPoints(Point3 p0, Point3 p1);
void add(Vector3 vector);
Point3 added(Vector3 vector);
void subtract(Vector3 vector);
Point3 subtracted(Vector3 vector);
float distanceTo(Point3 other);
float squaredDistanceTo(Point3 other);
void transform(Transformation t);
Point3 transformed(Transformation t);
bool operator ==(const Point3& other) const;
bool operator !=(const Point3& other) const;
friend std::ostream& operator <<(std::ostream& os, const Point3& pt) {
return os << "Point3(" << pt.x << ", " << pt.y << ", " << pt.z << ")";
}
};
}