Javascript Root Path Definition Math