Skip to content

CircleScale

The CircleScale class maps an input value to a circle radius such that the circle’s area is linearly proportional to the input value. This ensures that if the area of a circle is meant to represent a value, the radius is calculated appropriately.

pydreamplet.scales.CircleScale

CircleScale(
    domain: NumericPair,
    output_range: NumericPair
)

Parameters

  • domain (NumericPair): The numeric input domain.
  • output_range (NumericPair): The desired radius range (rmin, rmax).
from pydreamplet.scales import CircleScale

circle_scale = CircleScale((0, 100), (5, 20))
print(circle_scale.map(50))  # Outputs the radius corresponding to the value 50

map

map(value: float) -> float

Maps the input value to a circle radius based on area proportionality.

domain

Get or set the numeric domain.

output_range

Get or set the radius range.