• For dip try this instead:

    dip=180/Math.PI*Math.atan(yaw/Math.sqrt(­roll*roll+pitch*pitch));
    

    dip is positive in Northern and negative in Southern hemispheres.
    It ranges from -90 to +90.

About