in reply to whats up with the sin stuff?

sin expects the argument to be expressed in radians. If its geometry homework you're probably trying to work in degrees.