help me to turn line following bot by 90deg by using interrupters and encorders

hi, i want to turn my line following robot by 90 degrees very accurately. i'm thinking of performing it by using an Arduino 2560 mega.
could somebody tell me how to turn a bot by using interrupters, magnetic wheel encoders and motor drivers? sketch is preferred.
i'm using the motor - Pololu - 30:1 Metal Gearmotor 37Dx52L mm 12V with 64 CPR Encoder (No End Cap)

An encoder will tell you if the motor moved the amount you wanted it to. It won't tell you anything about what effect that had on the orientation of the robot.

That tree, over there, that's the one that you need to be barking up.

No Paul, it's like this
ticks of wheel encoder for 90 degrees = (2 * pi * (half distance between driven wheels of bot) )/4 * (ticks of encoders per unit length)
so i need a sketch to tackle the number of ticks that the above equation outputs by using interrupters. Actually speaking, i do not need the orientation. I want to turn my bot fast and accurately when the bot recognises a junction in a grid.

When the vehicle is turning sharply, the distance that the wheel travels on the ground bears little relationship to the amount that the wheel has turned. Good luck with that...

is that means I can not use the equation that I stated previously?