Skip to content

03 - Coordinate Systems and Scene Geometry

Before starting a simulation, it is critical to understand LESS's coordinate system and angle conventions. This chapter introduces these basic concepts.

Coordinate system

LESS uses a right-handed coordinate system with the origin at the northwest corner of the scene ground:

Coordinate system

axis direction unit
X East (East) Meters
Y South (South) Meters
Z Up (Up) Meters

The origin (0, 0, 0) is located at the northwest corner (upper left corner) of the scene ground, z = 0 is the ground.

Scene size

scene.size defines the coverage of the scene ground:

import less

scene = less.Scene()

# Square scene: 50m × 50m
scene.size = 50.0

# Rectangular scene: 100m (east-west) × 50m (north-south)
scene.size = (100, 50)

The scene ground extends from (0, 0) to (size_x, size_y) on the XY plane.

Object placement

The position coordinates of the object (x, y, z) follow the same coordinate system:

# Place a tree in the center of the scene (z=0 represents the ground)
positions = [[25.0, 25.0, 0.0]]
scene.add(tree, positions=positions)

# Place in the southeast corner
positions = [[45.0, 45.0, 0.0]]
scene.add(tree, positions=positions)

Angle agreement

Zenith Angle

Zenith angle is measured from directly above (zenith):

Zenith Angle Meaning
Directly above (zenith/nadir point)
30° Sun altitude angle 60°
60° Sun altitude angle 30°
90° Horizontal
# The sun is directly above
scene.illumination = less.Illumination(source=less.Sun(zenith=0, azimuth=180.0), atmosphere=less.NoAtmosphere())

# Sun altitude angle is about 60° (morning or afternoon)
scene.illumination = less.Illumination(source=less.Sun(zenith=30, azimuth=180.0), atmosphere=less.NoAtmosphere())

Azimuth Angle

Azimuth starts from due north and goes clockwise Measure:

Azimuth Direction
North (-Y)
90° East (+X)
180° South (+Y)
270° West (-X)
# The sun is in the southeast
scene.illumination = less.Illumination(source=less.Sun(zenith=30, azimuth=135), atmosphere=less.NoAtmosphere())

# The sensor looks from the west
sensor = less.Orthographic(
    view_zenith=30,
    view_azimuth=270,  # West
)

This is consistent with standard convention in the field of remote sensing.

Calculate sun position

LESS provides tools to calculate solar zenith angle/azimuth angle based on longitude, latitude and time:

from datetime import datetime
import less

# Beijing, June 21, 2024 10:00 (UTC+8)
sun = less.compute_sun_position(
    latitude=39.9,
    longitude=116.4,
    date_time=datetime(2024, 6, 21, 10, 0),
)
print(f"solar zenith angle: {sun.sun_zenith:.1f}°")
print(f"Sun azimuth angle: {sun.sun_azimuth:.1f}°")

Unit summary

Physical quantity Unit
Location, distance Meters (m)
Angle (zenith angle, azimuth angle) Degrees (°)
Reflectance/Transmittance Dimensionless [0, 1]
Wavelength Nanometer (nm)
Temperature Kelvin (K)
Irradiance W/m²/nm
Radiance W/m²/sr/nm

Next step

  • less.Sceneless.Objectless.Scene.add()
  • less.Illuminationless.Sunless.NoAtmosphereless.Orthographic
  • less.compute_sun_position()