Computer Science Canada

Triangle Solver Source Code

Author:  UBC_Wiskatos [ Mon Jun 30, 2003 11:10 pm ]
Post subject:  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. <a href="http://www.mironv.com/stuff/articles/TriangleSolver1.0SourceCod.shtml">Enjoy</a>!

Author:  Asok [ Tue Jul 01, 2003 2:35 am ]
Post subject: 

hm centroid... sounds painful Shocked

Laughing

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. Smile

Author:  SilverSprite [ Tue Jul 01, 2003 12:50 pm ]
Post subject: 

hmm.. i dunno if you used this but you can get the coordinates of the centroid by averaging the coordinates of the vertices..

Author:  UBC_Wiskatos [ Tue Jul 01, 2003 2:05 pm ]
Post subject: 

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.

Author:  Tony [ Tue Jul 01, 2003 3:30 pm ]
Post subject: 

thats why programming is soo useful 8)

I used to write programs on my TI-83+ and all homework was done in minutes Laughing 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.

Author:  krishon [ Tue Jul 01, 2003 4:42 pm ]
Post subject: 

lol, getting the right answer and understanding it counts...its just that the calculator does both Laughing

Author:  PaddyLong [ Wed Jul 02, 2003 9:10 am ]
Post subject: 

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 Very Happy

Author:  gigaman [ Thu Dec 11, 2003 6:42 pm ]
Post subject: 

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

Author:  Thuged_Out_G [ Thu Dec 25, 2003 11:36 pm ]
Post subject: 

tony wrote:
thats why programming is soo useful 8)

I used to write programs on my TI-83+ and all homework was done in minutes Laughing 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?

Author:  Tony [ Fri Dec 26, 2003 1:50 am ]
Post subject: 

Thuged_Out_G wrote:
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).

Author:  wtd [ Wed Feb 11, 2004 5:35 pm ]
Post subject: 

tony wrote:
Thuged_Out_G wrote:
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.


: