Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Game with Sprite Kit Actions and Animations Quick Math Lesson

Shaun Kelly
Shaun Kelly
5,648 Points

I don't understand how the blue point is (X3, Y3) !?

Shouldn't the blue point be (Y1.5, X1.5) because it's roughly in between 1 and 2 ?

2 Answers

Shaun Kelly
Shaun Kelly
5,648 Points

Video is to confusing but how do I calculate the yellow position based on the red and blue information ?

Stone Preston
Stone Preston
42,016 Points

you use the pythagorean theorem which states that a^2 + b^2 = c^2 where a is the height, b is the base and c is the hypotenuse.

Amit covers all the calculations at 3:40 of this video. it explains it visually and using the formulas. I suggest watching it a few times to make sure you undestand

Stone Preston
Stone Preston
42,016 Points

Shouldn't the blue point be (Y0.5, X0.5)

the numbers after x and y dont get multiplied by the values x and y.

(X3, Y3) is just a label for the point. its not the actual formula for the point, just a way of labeling the point so that we can refer to it easily

there are 3 points and we need to be able to distinguish between the coordinates of each one. so we give the first point's coordinates labels of X1 and Y1, the second point's coordinates X2 and Y2, and the third point's coordinates X3 and Y3.

We could have labeled the points with anything, its just the methods described above are standard and easier to understand