Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Triangle Solver Source Code
Index -> Programming, C++ -> C++ Tutorials
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
UBC_Wiskatos




PostPosted: 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
Sponsor
sponsor
Asok




PostPosted: Tue Jul 01, 2003 2:35 am   Post subject: (No 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
SilverSprite




PostPosted: 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




PostPosted: 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




PostPosted: 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 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
krishon




PostPosted: 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 Laughing
PaddyLong




PostPosted: 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 Very Happy
gigaman




PostPosted: 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
Sponsor
sponsor
Thuged_Out_G




PostPosted: 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 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?
Tony




PostPosted: 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).
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
wtd




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 11 Posts ]
Jump to:   


Style:  
Search: