
-----------------------------------
UBC_Wiskatos
Mon Jun 30, 2003 11:10 pm

Triangle Solver Source Code
-----------------------------------
This is some code I whipped up a while ago for a math class, so I could check my work easily. Currently, it can do the following with a triangle:

Find the slopes of all three sides
Find the lengths of all three sides
Find the midpoints of all three sides
Calculate the equations of the medians, perpendicular bisectors, and altitudes
Calculate the centroid, circumcentre, and orthocentre

This code is really simple, and was written quickly at night, so some of it may be poorly executed. However, it is very thoroughly documented, and you might learn some stuff about C++ by taking a look at it. Enjoy!

-----------------------------------
Asok
Tue Jul 01, 2003 2:35 am


-----------------------------------
hm centroid... sounds painful  :shock: 

 :lol: 

very nice stuff here, now not only do I never have to use mental math, I never even have to fiddle with calculators, my life is getting easier all the time. :)

-----------------------------------
SilverSprite
Tue Jul 01, 2003 12:50 pm


-----------------------------------
hmm.. i dunno if you used this but you can get the coordinates of the centroid by averaging the coordinates of the vertices..

-----------------------------------
UBC_Wiskatos
Tue Jul 01, 2003 2:05 pm


-----------------------------------
I know, I forget what way I did it in the program though. I was just going by the textbook when I wrote it, I think.

-----------------------------------
Tony
Tue Jul 01, 2003 3:30 pm


-----------------------------------
thats why programming is soo useful  8) 

I used to write programs on my TI-83+ and all homework was done in minutes  :lol: My teacher didnt like it though. Somethinig about homework being work that we had to do not just come up with the right answer...

Oh well.

-----------------------------------
krishon
Tue Jul 01, 2003 4:42 pm


-----------------------------------
lol, getting the right answer and understanding it counts...its just that the calculator does both  :lol:

-----------------------------------
PaddyLong
Wed Jul 02, 2003 9:10 am


-----------------------------------
hm homework?  blah you don't need to do homework... not unless of course your teacher is an idiot and actually checks /me shudders 
just like do the assignments and stuff you actually have to hand in and count and you're fine :D

-----------------------------------
gigaman
Thu Dec 11, 2003 6:42 pm


-----------------------------------
I usualy avg the vertices even though my teacher dosn't like it. and i don't think i've ever had a math teacher who checked my homework

-----------------------------------
Thuged_Out_G
Thu Dec 25, 2003 11:36 pm


-----------------------------------
thats why programming is soo useful  8) 

I used to write programs on my TI-83+ and all homework was done in minutes  :lol: My teacher didnt like it though. Somethinig about homework being work that we had to do not just come up with the right answer...

Oh well.

hmmm...we have those calcs at my school, what langauge is used to write programs?

-----------------------------------
Tony
Fri Dec 26, 2003 1:50 am


-----------------------------------
what langauge is used to write programs?

well... it has it's own version of BASIC as far as I know... I used to write code right on the calculator, although there're other variant compilers where you download the file player and files (thats how most of games are made).

-----------------------------------
wtd
Wed Feb 11, 2004 5:35 pm


-----------------------------------
what langauge is used to write programs?

well... it has it's own version of BASIC as far as I know... I used to write code right on the calculator, although there're other variant compilers where you download the file player and files (thats how most of games are made).

Most of the games actually are written in Z80 assembly.  That's why they're so bloody fast.
