Introducing Math Tools
BrushCue is best known for image editing, but we've started building a separate, growing set of free math and calculation tools that run entirely in your browser. Today we're introducing our first batch, covering geometry, arithmetic, and trigonometry.
Geometry
- Pythagorean Theorem — solve for a right triangle's hypotenuse from its two other sides.
- Square Area
- Rectangle Area
- Triangle Area
- Parallelogram Area
- Trapezoid Area
- Circle Area
- Ellipse Area
Arithmetic
- Factorial — calculate the product of all positive integers up to a given number.
Trigonometry
- Degrees to Radians
- Radians to Degrees
- Sine (Degrees)
- Sine (Radians)
- Cosine (Degrees)
- Cosine (Radians)
These aren't disconnected from image editing
BrushCue Script, our language for building BrushCue processing graphs, is not limited to composition operations like blurs, blends, and distortions. It also supports plain numeric computation — addition, multiplication, powers, square roots, sine, and cosine among others — and those values can feed directly into an image editing pipeline.
That means the same geometry and trigonometry behind the tools above can drive an effect's parameters instead of a single hardcoded number. For example, computing a hypotenuse and using it to size a bloom:
image = Composition::monet_women_with_parasol()
a = 3.0
b = 4.0
hypotenuse = (a.pow(2.0) + b.pow(2.0)).square_root()
image.bloom(hypotenuse * 0.1, 22.5, 0.5)
Or converting degrees to radians and taking a sine to drive brightness:
image = Composition::monet_women_with_parasol()
angle_degrees = 30.0
angle_radians = angle_degrees * 0.017453292519943295
brightness_amount = angle_radians.sin() + 1.0
image.brightness_adjust(brightness_amount)
Because BrushCue Script expressions describe a graph rather than a one-off calculation, these computations stay reusable and inspectable alongside the rest of your pipeline. We'll keep growing both the math tools and the computation nodes available in BrushCue Script.