Author |
Message |
UBC_Wiskatos
|
Posted: 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. Enjoy! |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Asok
|
Posted: Tue Jul 01, 2003 2:35 am Post subject: (No subject) |
|
|
hm centroid... sounds painful
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
|
Posted: Tue Jul 01, 2003 12:50 pm Post subject: (No subject) |
|
|
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
|
Posted: Tue Jul 01, 2003 2:05 pm Post subject: (No 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. |
|
|
|
|
|
Tony
|
Posted: Tue Jul 01, 2003 3:30 pm Post subject: (No subject) |
|
|
thats why programming is soo useful 8)
I used to write programs on my TI-83+ and all homework was done in minutes 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. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
krishon
|
Posted: Tue Jul 01, 2003 4:42 pm Post subject: (No subject) |
|
|
lol, getting the right answer and understanding it counts...its just that the calculator does both |
|
|
|
|
|
PaddyLong
|
Posted: Wed Jul 02, 2003 9:10 am Post subject: (No 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 |
|
|
|
|
|
gigaman
|
Posted: Thu Dec 11, 2003 6:42 pm Post subject: (No 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 |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Thuged_Out_G
|
Posted: Thu Dec 25, 2003 11:36 pm Post subject: (No 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 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
|
Posted: Fri Dec 26, 2003 1:50 am Post subject: (No 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). |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
wtd
|
Posted: Wed Feb 11, 2004 5:35 pm Post subject: (No 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. |
|
|
|
|
|
|