-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathR3Graph.h
More file actions
67 lines (55 loc) · 1008 Bytes
/
R3Graph.h
File metadata and controls
67 lines (55 loc) · 1008 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef R3GRAPH_H
#define R3GRAPH_H
#include "R2Graph.h"
#include <iostream>
class R3Point {
protected:
double x, y, z;
public:
R3Point ():
x(0),
y(0),
z(0)
{}
R3Point (double x, double y, double z):
x(x),
y(y),
z(z)
{}
double getX() { return x; };
double getY() { return y; };
double getZ() { return z; };
void print();
bool inCube();
};
class InterPlane: public R3Point {
private:
double A;
double B;
double C;
double D;
double findT(double a, double b, double c,
double x, double y, double z);
void findInter(R3Point *pts, int n,
double a, double b, double c,
double x, double y, double z);
public:
InterPlane():
A(1),
B(0),
C(0),
D(0)
{}
InterPlane(double A, double B, double C,
double x, double y, double z):
A(A),
B(B),
C(C),
D(-(A*x + B*y + C*z))
{}
InterPlane& operator=(const InterPlane &plane);
void set(double A, double B, double C,
double x, double y, double z);
R3Point* interWithCube();
};
#endif