# sine + normal

## Recommended Posts

kneeride    128
Hi Guys, I need a maths guru to help with this one. ;) I wish to calculate the normal of the curve at sine x. Any ideas? Thanks

##### Share on other sites
Jaywalk    250
Any point on this curve will be at (x, sin x)

dx/dx=1 and d(sin x)/dx=cos x

So the vector (1, cos x) will point in the direction of the tangent. The normal is perpendicular to the tangent, which gives us (-cos x, 1). Remember to normalise this if you need a unit vector.

[Edited by - Jaywalk on May 3, 2007 4:28:00 AM]

##### Share on other sites
kneeride    128
Great formula!

I however find my results are perpendicular to the normal.

eg.
sin(pi / 2)
from looking at the graph, the normal is (0, 1) ie pointing straight up.

However when i apply the formula:

n = (1, cos(pi / 2)) = (1, 0)

The normal points in the x direction which is perpendicular to what i was expecting.

##### Share on other sites
Jaywalk    250
Ah, sorry. Confused normal with tangent. I'll correct my previous post now.

##### Share on other sites
kneeride    128
thanks heaps.
i had started researching into finding the perpendicular vector from the tangent ;)

##### Share on other sites
Jaywalk    250
In 2 dimensions, there's an easy formula for finding perpendicular vectors. A vector (x, y) will be perpendicular to (-y, x).

If you ever happen to need to find perpendicular vectors in 3 or more dimensions then research how to perform a "cross product".