-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForce.cs
39 lines (37 loc) · 789 Bytes
/
Force.cs
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
using System;
using Symbolism;
namespace TMISolver{
public class Force {
public Point position;
public Vector vec;
public Force(Point pos, MathObject _Fx, MathObject _Fy) {
position = pos;
vec = new Vector(_Fx, _Fy);
}
public Force(Point pos, MathObject _Fx, MathObject _Fy, MathObject _Fz) {
position = pos;
vec = new Vector(_Fx, _Fy, _Fz);
}
public void Print() {
Console.WriteLine("Postion:");
this.position.Print();
Console.WriteLine("Force:");
this.vec.Print();
}
public MathObject Index(int index){
switch (index) {
case 0: {
return this.vec.x();
}
case 1: {
return this.vec.y();
}
case 2: {
return this.vec.z();
}
default:
throw new Exception("Index out of bounds!");
}
}
}
}