# 3. Directional distance from lord to Lagna house (always forward in zodiac) delta = (1 - lord_house) mod 12 if delta == 0: delta = 12
Exception: AL_pre == Lagna (1) → final AL = 10th house. arudha lagna calculator
If ( AL_pre = H_L ) (i.e., AL falls in Lagna itself), then AL is 10th house from Lagna . If ( AL_pre ) is exactly the 7th house from Lagna, then AL is 4th house from Lagna . 3. Algorithm for an Arudha Lagna Calculator The following pseudo-code implements the classic Parashari rule. 3.1 Pseudo-code function calculate_arudha_lagna(lagna_degrees, house_positions_of_planets): # lagna_degrees: 0-360 # house_positions: dict planet: house_number 1..12 # 1. Find Lagna sign and its lord lagna_sign = floor(lagna_degrees / 30) + 1 # 1=Aries ... 12=Pisces lord_of_lagna = get_planet_ruler(lagna_sign) # e.g., Mars for Aries If ( AL_pre ) is exactly the 7th