This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-07-07 12:02:01

Sperry
Scratcher
Registered: 2010-03-09
Posts: 500+

Need some help, might need trig

Well, I want ot find two sides of a right-angled triangle, like this:

    y
  ___
|    /
x| / z
|/

I know what z is, but how do I calcuate the other two?

Also, x continues upwards, and y continues to the left.

Any help would be appreciated.


http://img709.imageshack.us/img709/3252/gobanim2.gifhttp://ls.gd/bo

Offline

 

#2 2010-07-07 12:10:12

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Need some help, might need trig

you need to know the angle between y and z or x and z as well.

http://en.wikipedia.org/wiki/Triangle#Using_trigonometry

will help you calculate it. jump to "trigonometry"

and please get on dropbox!

Last edited by sparks (2010-07-07 12:10:37)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#3 2010-07-07 12:20:46

Sperry
Scratcher
Registered: 2010-03-09
Posts: 500+

Re: Need some help, might need trig

sparks wrote:

you need to know the angle between y and z or x and z as well.

http://en.wikipedia.org/wiki/Triangle#Using_trigonometry

will help you calculate it. jump to "trigonometry"

and please get on dropbox!

The angles change depending on the length of z though, don't they? And that will change...


Anyway, can you e-mail me the password for dropbox please?


http://img709.imageshack.us/img709/3252/gobanim2.gifhttp://ls.gd/bo

Offline

 

#4 2010-07-07 12:26:01

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Need some help, might need trig

done.

yes, you need to know at least one side and one angle to calculate anything else about a right-angle triangle.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#5 2010-07-07 12:29:00

Sperry
Scratcher
Registered: 2010-03-09
Posts: 500+

Re: Need some help, might need trig

sparks wrote:

done.

yes, you need to know at least one side and one angle to calculate anything else about a right-angle triangle.

well, xy is 90 degrees I know that...


http://img709.imageshack.us/img709/3252/gobanim2.gifhttp://ls.gd/bo

Offline

 

#6 2010-07-07 12:29:47

cds56
Scratcher
Registered: 2008-05-02
Posts: 500+

Re: Need some help, might need trig

Sperry wrote:

Well, I want ot find two sides of a right-angled triangle, like this:

    y
  ___
|    /
x| / z
|/

Y can only be one length.

and with z being it's length, already known to you, x and y can only have one possible length.

There's some easy way of doing it, but I forget it.

): sorry.


http://img192.imageshack.us/img192/909/meowdevlogo.pnghttp://i32.tinypic.com/pucti.png

Offline

 

#7 2010-07-07 12:30:11

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Need some help, might need trig

...except said 90° angle  sad   tongue  did you get the email? can you log in?


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#8 2010-07-07 12:33:24

Sperry
Scratcher
Registered: 2010-03-09
Posts: 500+

Re: Need some help, might need trig

@sparks:
1) Ahhh, The others change depending... I think
2) Blasted Dropbox won't install!!!

@cds56:
Don't worry, but thanks for trying!  smile


http://img709.imageshack.us/img709/3252/gobanim2.gifhttp://ls.gd/bo

Offline

 

#9 2010-07-07 12:35:02

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Need some help, might need trig

why don't you have dropbox? computer change?


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#10 2010-07-07 12:37:59

Sperry
Scratcher
Registered: 2010-03-09
Posts: 500+

Re: Need some help, might need trig

sparks wrote:

why don't you have dropbox? computer change?

No, system cleanup.


http://img709.imageshack.us/img709/3252/gobanim2.gifhttp://ls.gd/bo

Offline

 

#11 2010-07-07 18:00:13

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Need some help, might need trig

Are both x and y of variable (not constant) length?


nXIII

Offline

 

#12 2010-07-08 05:55:13

Sperry
Scratcher
Registered: 2010-03-09
Posts: 500+

Re: Need some help, might need trig

nXIII wrote:

Are both x and y of variable (not constant) length?

They are both a fraction of a variable that changes.


http://img709.imageshack.us/img709/3252/gobanim2.gifhttp://ls.gd/bo

Offline

 

#13 2010-07-08 09:26:43

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Need some help, might need trig

Sperry wrote:

nXIII wrote:

Are both x and y of variable (not constant) length?

They are both a fraction of a variable that changes.

if they are always the same fraction then they can be calculated from the variable.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#14 2010-07-08 09:49:44

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: Need some help, might need trig

You can try:               ___________
  hypotenuse (z)   =   \/   x^2 + y^2    if you have two lenghts. Because the equations you are trying to solve have 3 or more varaibles you need to know at least two to solve it.


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

#15 2010-07-08 10:18:35

Sperry
Scratcher
Registered: 2010-03-09
Posts: 500+

Re: Need some help, might need trig

I know the hypotenuse, and the fractions change.

Basicly, I'm trying to draw a 3D Rectangle, without using [move X steps] blocks and just using goto x: X y: Y


http://img709.imageshack.us/img709/3252/gobanim2.gifhttp://ls.gd/bo

Offline

 

#16 2010-07-08 17:32:17

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Need some help, might need trig

3d rectangle? Use projection algorithms:
x = x * c / x
y = y * c / z

and rotation algorithms:
about x axis:
y = y * cos(theta) - z * sin(theta)
z = y * sin(theta) + z * cos(theta)
about y axis:
x = x * cos(theta) - z * sin(theta)
z = x * sin(theta) + z * cos(theta)
about z axis:
x = x * cos(theta) - y * sin(theta)
y = x * sin(theta) + y * cos(theta)

...I think.

Last edited by nXIII (2010-07-08 17:33:02)


nXIII

Offline

 

#17 2010-07-08 17:45:32

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Need some help, might need trig

^ I believe they are correct


You can now reach me on Twitter @johnnydean1_

Offline

 

#18 2010-07-08 23:17:19

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: Need some help, might need trig

Sperry wrote:

sparks wrote:

yes, you need to know at least one side and one angle to calculate anything else about a right-angle triangle.

well, xy is 90 degrees I know that...

One angle other than the right angle.  smile

In order to determine any triangle, you need three of
the six values (three sides, three angles), including at least one side (because with only the three angles you can scale the triangle to whatever size you want).  You know one angle (the right angle) and one side (the hypotenuse).  You need one more side or one more angle.  (Actually just so someone doesn't call me on this, if you know two sides and an angle that isn't the one between the two sides, then there are two different-shaped possible triangles.)


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

Board footer