Computer Science Canada Cosine inverse? |
Author: | not_l33t [ Thu May 20, 2004 6:12 pm ] |
Post subject: | Cosine inverse? |
Is it possible to do a cos-1 in Turing. I need it for a program that I am creating for finding the degrees of angle and telling if its a right angle triangle or not. I am simply going to use the elseif and else commands. So can you guys help me with the cosine. |
Author: | Pickles [ Thu May 20, 2004 6:26 pm ] |
Post subject: | ... |
isnt that 1/cos ? |
Author: | not_l33t [ Thu May 20, 2004 6:28 pm ] |
Post subject: | Re: ... |
Pickles wrote: isnt that 1/cos ?
That don't work. |
Author: | AsianSensation [ Thu May 20, 2004 6:31 pm ] |
Post subject: | |
arccosd or arccos, depending on whether you want it in radian or degree form. |
Author: | not_l33t [ Thu May 20, 2004 6:32 pm ] |
Post subject: | |
AsianSensation wrote: arccosd or arccos, depending on whether you want it in radian or degree form.
Dude you're my hero. |
Author: | not_l33t [ Thu May 20, 2004 6:59 pm ] |
Post subject: | |
Quote: var a, b, c : real
var x1, x2, x3, y1, y2, y3, t1, t2, t3 : real var u1, u2, u3, i1, i2, i3 : real put "Enter the length of the first side of the triangle." get a put "Enter the length of the second side of the triangle." get b put "Enter the length of the third side of the triangle." get c x1 := -2 * (b) * (c) x2 := -2 * (a) * (c) x3 := -2 * (a) * (b) y1 := b ** 2 + c ** 2 y2 := a ** 2 + c ** 2 y3 := a ** 2 + b ** 2 t1 := a ** 2 - y1 t2 := b ** 2 - y2 t3 := c ** 2 - y3 u1 := t1 / x1 u2 := t2 / x2 u3 := t3 / x3 i1 := arccosd (u1) i2 := arccosd (u2) i3 := arccosd (u3) put "First angle is: ", i1 put "Second angle is: ", i2 put "Third angle is: ", i3 Anyone in TDSB taking Grade 10 TIK will be thanking me a lot. |
Author: | not_l33t [ Thu May 20, 2004 7:54 pm ] | ||
Post subject: | |||
I am having problems exiting this program. I want the program to exit when one of the angle is 90 degrees. Put these values in as they make a right angle triangle when it asks you when it runs: 1, 2, 1.732050808. |
Author: | not_l33t [ Thu May 20, 2004 10:11 pm ] |
Post subject: | |
Anyone? |