Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 25th, 2007, 11:44 AM   #1
ReggaetonKing
Sexy Programmer
 
ReggaetonKing's Avatar
 
Join Date: Nov 2005
Location: New Jersey
Posts: 891
Rep Power: 3 ReggaetonKing is on a distinguished road
Send a message via AIM to ReggaetonKing
Finding All Sides and Angles of a Triangle

In my Trig class, we are going over Laws of Sin and Heron's Formula. I am making a program where a user can enters the angles and the side of a oblique triangle and whatever is left blank the program will calculate the rest sides and angles that the user did not enter.

My program can also calculate the area if all the sides of the triangle are given.

Knowing the math and formulas is not a problem for me, The problem is just figuring out which sides and/or angles to calculate. Instead of having a thousand if statements!

Here is my source for far. I attached a .zip file containing my source.

Help will be greatly appreciated!
Attached Files
File Type: zip TrigProject.zip (64.5 KB, 29 views)
__________________
I would love to change the world, but they won't give me the source code!
ReggaetonKing is offline   Reply With Quote
Old May 25th, 2007, 7:16 PM   #2
Wizard1988
Professional Programmer
 
Wizard1988's Avatar
 
Join Date: Oct 2005
Location: Chitown
Posts: 417
Rep Power: 3 Wizard1988 is on a distinguished road
Send a message via AIM to Wizard1988
You might also want to check out the law of cosines.
http://en.wikipedia.org/wiki/Law_of_cosines
__________________
JG-Webdesign
Wizard1988 is offline   Reply With Quote
Old May 25th, 2007, 11:40 PM   #3
physicist
Hobbyist Programmer
 
Join Date: Oct 2006
Posts: 146
Rep Power: 2 physicist is on a distinguished road
i agree. law of cosines can solve some problems that take more steps with the other two formulas
physicist is offline   Reply With Quote
Old May 26th, 2007, 1:59 AM   #4
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 582
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
Quote:
Originally Posted by reggaeton_king View Post
The problem is just figuring out which sides and/or angles to calculate. Instead of having a thousand if statements!
use 500 if statements instead, i think 1000 is a few too many
__________________
Quote:
Originally Posted by DaWei View Post
Well, it's better than Pen Islands url....;)

crawforddavid2006 is offline   Reply With Quote
Old May 26th, 2007, 4:54 AM   #5
pegasus001
Hobbyist Programmer
 
pegasus001's Avatar
 
Join Date: Nov 2006
Location: 163H
Posts: 213
Rep Power: 2 pegasus001 is on a distinguished road
Quote:
Originally Posted by reggaeton_king View Post
The problem is just figuring out which sides and/or angles to calculate. Instead of having a thousand if statements!
The law of sine and cosine aren`t constrained by the names of the angles or sides. The user just has to input the values and according to them the program has to evaluate the answer. Just put the picture triangle and tell the user to input the values accordingly.
__________________
You never test the depth of a river with both feet.
The believer is happy. The doubter is wise.
Free speech carries with it some freedom to listen.
The next generation will always surpass the previous one. It`s one of the never ending cycles of life.
pegasus001 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:10 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC