Astrology Engine

One circle,
many angles.

Learn how this course works with a small calculation you can see.

Different numbers, the same direction

Imagine an arrow turning around a circle. After one complete turn it points in the same direction as when it started, even though it has traveled all the way around. We can describe the movement with a larger angle, or describe the final direction with a smaller one. Those two numbers tell different parts of the same story.

A full turn contains 360 degrees, written 360°. An angle of 390° therefore takes the arrow through one full turn and another 30°. If we want to describe just where the arrow points, we can subtract the completed turn:

390° − 360° = 30°

The result is a smaller number with the same direction. Removing complete turns in this way is called wrapping an angle. You will use this idea later when a calculation produces an angle beyond the end of a circle and we need a consistent way to report it.

Try the slider below and watch the arrow. The readout gives both the supplied angle and its wrapped value. Moving through a full turn changes the supplied number by 360°, but brings the arrow back to the same direction. This circle is a teaching diagram, rather than a projection of the sky.

0°90°180°270°
A teaching circle: angles increase counterclockwise from the right. This is not a sky map.
390°30°

Move the slider, or use the arrow keys. A full turn changes the number by 360° and leaves the direction unchanged.

From examples to a rule

Subtraction worked for an angle greater than one full turn. For a negative angle, we can work in the other direction. Starting at −30°, adding a full turn gives −30° + 360° = 330°. The arrow still points to the same place; we have simply described that direction using a positive angle.

Exactly 360° wraps to 0°. Both numbers describe the starting direction, and choosing 0° gives us one consistent value to use at that boundary. The same reasoning works for several complete turns: keep removing or adding 360° until the value is at least zero and less than 360.

Mathematicians write that range as Reading the interval [0, 360) This notation means every value from 0 up to, but not including, 360. The square bracket includes the left endpoint, while the round bracket excludes the right endpoint.For wrapped angles, 0 is included and 360 is excluded because both point in the same direction. Keeping only one of them gives each direction a single representative within this interval. . You do not need to memorize the notation to perform the calculation, but recognizing it will help you read later formulas. The rule is to keep the direction while removing any complete turns from the reported angle.

See a TypeScript version
const wrapDegrees = (angle: number): number =>
  ((angle % 360) + 360) % 360;

TypeScript uses JavaScript’s remainder operator, written %. Taking the remainder after division by 360 removes complete turns, but a negative input can leave a negative remainder. Adding 360 and taking the remainder again brings the answer into [0, 360). For 390°, the first remainder is 30; adding 360 gives 390, and the second remainder returns 30.

Use finite inputs only. This is teaching code; comparisons near floating-point boundaries need a stated tolerance. The example demonstrates angle arithmetic and does not calculate a planetary position or establish numerical agreement with the Rust engine.

Degrees and other ways to measure a turn

A degree is defined as one three-hundred-and-sixtieth of a full turn. The International Bureau of Weights and Measures’ units brochure, section 4, table 8 relates degrees to another angle unit, the radian: 1° = π/180 radians. We will explain that unit and the conversion when a later calculation needs them.

Try the idea

Pass both parts to complete orientation. You can retry as often as you like.

Answer in degrees, without a unit symbol. A whole number is enough; accepted tolerance is ±0.01°.

2. Why do 390° and your answer describe the same direction?