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

#1 2008-10-02 13:25:40

Nikimax
Scratcher
Registered: 2008-06-22
Posts: 36

Need some math...

Hello! I'm trying to make a new game with using improved collision detection and so, i need to use math. Im only in 6th class and i don't know how to done:
I have 2 segments and  i know x and y coordinates of their start and end. I need a function (scratch-program) that shows 1 if 1 of mine segments traverse another one or 0 otherwise.
http://www.imageup.ru/img2/traversecheck57259.jpg
Can any1 write it for me, please?


http://scratch.mit.edu/projects/Nikimax/291754
Test yourself=)

Offline

 

#2 2008-10-02 14:25:50

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Need some math...

Here is a discussion that talks about this problem and the math required

http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2008-10-03 13:50:14

Nikimax
Scratcher
Registered: 2008-06-22
Posts: 36

Re: Need some math...

Great tutorial, thank you for help


http://scratch.mit.edu/projects/Nikimax/291754
Test yourself=)

Offline

 

Board footer