Overview
The Graphics Calculator (calculator.html) is the original Romasm function plotting tool. It allows you to plot Romasm functions with customizable graph bounds and includes support for both Cartesian and polar coordinate plotting.
Note: For a more full-featured calculator experience, see the Romasm Calculator.
Features
Function Plotting
Plot functions defined in Romasm assembly:
- Enter Romasm code for f(x)
- Input: R0 = x (scaled by 100)
- Output: R0 = f(x) (scaled by 100)
- Functions are evaluated at multiple points and plotted
Graph Modes
Switch between different plotting modes:
- Function Mode: y = f(x) - Standard Cartesian plotting
- Polar Mode: r = f(θ) - Polar coordinate plotting
Customizable Bounds
Set graph window settings:
- X Min/Max - Horizontal range
- Y Min/Max - Vertical range
- Step Size - Resolution of plotting
- Auto-adjustment for polar curves
Preset Functions
Quick-load preset functions:
- Basic: x², x³, sin(x), cos(x)
- Polar: Rose curves, cardioid, spiral
- Advanced: Exponential, logarithmic
Using the Graphics Calculator
Step 1: Select Mode
Choose "Function (y=f(x))" or "Polar (r=f(θ))" from the dropdown.
Step 2: Enter Function
Type or select a Romasm function. For example, to plot y = x²:
LOAD R1, R0
MUL R0, R1
LOAD R1, 100
DIV R0, R1
RET
Step 3: Set Bounds
Configure X Min/Max, Y Min/Max, and Step Size.
Step 4: Plot
Click "Run" to plot the function.
Polar Plotting
In polar mode, functions define r as a function of θ:
- Input: R0 = θ in degrees (scaled by 100)
- Output: R0 = r (scaled by 100)
- Automatically converts to Cartesian: x = r×cos(θ), y = r×sin(θ)
- Handles negative r values correctly
- Auto-adjusts graph bounds based on max r
Related Documentation
- Romasm Calculator - Full-featured calculator
- Trigonometric Functions - For polar curves
- Canvas Drawing - How graphs are rendered
- Try the Graphics Calculator - Open it now!