Hp 50g Math question: Intersection of 2 triangulars
|
12-25-2013, 01:10 PM
Post: #12
|
|||
|
|||
RE: Math question: Intersection of 2 triangulars
Hello all,
The great program for solving this problem isn't ready. But the frame programe is ready and some sub programs which I want to present. Some remarks: I use the decimal comma and not a point and the command \->NUM can be deleted if it is shure that all values are reals (otherwise the if conditions will not work correct). The programs are all "hard coded", I don't use the solve abilities of the HP 50g in hope that my solutions are faster and I can format the output in a way I want. If your are interested in the mathematics behind these programs, let me know. The first one: "NONUL": Its function is to find a non-zero value in a 3-dim vector. Input: stack 1: a vector Output: stack 2: value stack 1: index This program is used in program "CUTLL" avoiding a possible division by zero.. Code:
The second is called: "CUTPL" Its function is to find a interection between a line and a plane. Input: stack 4: position vector of the line stack 3: direction vector of the line stack 2: position vector of the plane stack 1: normal vector of the plane Output: stack 1: { } if there is no intersection stack 1: { [position vector] [direction vector] } if the line lies in the plane stack 1: single value (if that value is inserted in the line equation you get the position vector of the intersecting point.) Because this value is importent later on, this program stops here with the calculation. Code:
The third one is "CUTLL". Its function is to find a interection between a line and a line. Input: stack 4: position vector of the line 1 stack 3: direction vector of the line 1 stack 2: position vector of the line 2 stack 1: direction vector of the line 2 Output: stack 1: { } if there is no intersection stack 1: { [position vector 1] [direction vector 1] } if the lines are identical stack 1: single value (if that value is inserted in the line equation of line 1 you get the position vector of the intersecting point.) Because this value is importent later on, this program stops here with the calculation. Code:
Sincerely peacecalc |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)