Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Triangle Solver Source Code
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!

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

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

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.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 11 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: