ERG – Trapezoidal

ERG – Trapezoidal

Document Status and Current Reference

This page preserves an earlier formulation or research method. Its notation, formulas, and embedded demonstrations belong to that version and should not be treated as the specification of the current binary radial kernels.

Read the current formulation and its analytical verification. Historical performance statements and implementation behaviour require separate validation. Earlier references to circular constants remain in this historical document; they are not inputs to the current geometric kernel definitions.

Δx Trapezoidal (Cartesian)

Area from the inside on the quarter of a circle. Sample uniformly on the x-axis with $\Delta x=r/N$, build trapezoids strictly under the arc $y(x)=\sqrt{r^2-x^2}$, then multiply by 4 for the full circle. No angles and no external constants appear in the primary operators.

Setup (quarter)

$$ \Delta x=\frac{r}{N},\qquad x_k=k\,\Delta x\ \ (k=0,\dots,N),\qquad y_k=\sqrt{\,r^2-x_k^2\,}. $$

Quarter area (→ ×4 for the circle)

$$ A_{\text{quarter}}(N)\;=\;\sum_{k=0}^{N-1}\frac{\Delta x}{2}\,\bigl(y_k+y_{k+1}\bigr), \qquad A_{\text{circle}}(N)\;=\;4\,A_{\text{quarter}}(N). $$

Because $y(x)$ is concave on $[0,r]$, these trapezoids give a monotone under-approximation. The error typically decays like $O(N^{-2})$. A quick check is step-doubling: compare $A_{\text{circle}}(N)$ vs $A_{\text{circle}}(2N)$.

Quarter with Δx trapezoids (Cartesian x–y) Strict Cartesian axes (equal units). r=100, N=5 ⇒ Δx=20. Trapezoids are inside the quarter arc. x y
Fig. 1 — Δx trapezoids strictly inside the quarter arc (example: $r=100$, $N=5$).

Single strip geometry

Between $x_k$ and $x_{k+1}$ the trapezoid has bases $y_k$ and $y_{k+1}$ and width $\Delta x$; the arc segment lies strictly above it.

One Δx trapezoid under the arc Strip between x=60 and x=80 for r=100. Heights are y_k=80 and y_{k+1}=60. Dashed arc segment shown above the trapezoid. x y
Fig. 2 — One Δx strip (here $k=3$): the arc is strictly above the trapezoid.

Pseudocode

Input: r, N
Δx = r / N
Aq = 0
for k = 0..N-1:
    yk   = sqrt(r*r - (k*Δx)*(k*Δx))
    yk1  = sqrt(r*r - ((k+1)*Δx)*((k+1)*Δx))
    Aq  += 0.5 * Δx * (yk + yk1)
A_circle = 4 * Aq
  

Notes

  • Monotone: $A_{\text{circle}}(N)$ increases with $N$ and approaches the true area from below.
  • Accuracy: smooth $O(N^{-2})$ decay; step-doubling is a simple diagnostic.
  • Implementation: works cleanly with fixed-point or vectorized code (just sums and square roots).
Circumference & Sphere

Circumference & Sphere

Why “Certainly on the Circumference” (and on the Sphere)

Category: Debate

Most ways to “draw a circle” are approximations: they split the arc into chords, use regular polygons, or compute points from arc lengths (where \(\pi\) eventually appears). In GRG we do the opposite: we do not measure the arc, we enforce the distance. We fix a radius \(R\) and choose a geometric direction; the generated point is the endpoint of a segment of length \(R\) from a center \(O\). By definition, that point is at distance \(R\) from \(O\): therefore it is certainly on the circumference. No approximation, no \(\pi\) needed.

What we prove, in plain words

In 2D, every point built as \((x,y)=(R\cos\varphi,\,R\sin\varphi)\) identically satisfies

$$x^{2}+y^{2}=R^{2}.$$

It does not “tend” to the circle: it is on the circle.

In 3D, take a unit direction \(\mathbf{u}\) and set \(\mathbf{P}=R\,\mathbf{u}\). By construction \(\|\mathbf{P}\|=R\): the point is certainly on the sphere

$$x^{2}+y^{2}+z^{2}=R^{2}.$$

The heart of it is: distance first. If the distance from the center is enforced to be \(R\), every generated point belongs to the locus of points at distance \(R\). That is the very definition of circle/sphere.

“Then what are sine and cosine for?”

Here they are not approximate numbers: they are ratios of sides in similar right triangles. They serve as a language to express the Cartesian projections of the chosen direction: \[ x=R\cos\varphi,\qquad y=R\sin\varphi. \] Even if, in a digital controller, you compute them with finite precision, the geometric law you implement remains exact: the commanded points are those of the ideal object defined by \(x^{2}+y^{2}=R^{2}\) (or \(x^{2}+y^{2}+z^{2}=R^{2}\)).

If you wish to avoid direct computation of \(\sin\) and \(\cos\) altogether, there is an equivalent incremental form: rotate the vector \((x,y)\) by multiplying it with an orthogonal matrix. Orthogonal matrices preserve the norm: every step remains on the circle by construction.

“What about error accumulating at each step?”

Distinguish carefully:

  • Geometric law (GRG): exact. The norm is preserved at each step (rotations), therefore there is no geometric drift.
  • Physical implementation: it can introduce errors (backlash, compliance, friction, encoder resolution, numerical rounding). These are real-world errors, not flaws of the idea.

In digital control, the small loss/gain of norm due to rounding is removed with three simple techniques:

\(\text{(i) adequate precision}\quad \text{(ii) occasional renormalization enforcing }x^{2}+y^{2}=R^{2}\quad \text{(iii) periodic recomputation from }\varphi.\)

In all cases, the reference object remains the perfect circle/sphere.

“But the machine moves in straight lines, not curves!”

What you often see is the visualization (a polyline between samples). It is not the definition of the path. The GRG law commands instantaneous poses that lie on the circle/sphere. The drive’s interpolation between samples may be linear or spline-based: that is a control choice. If you want a “fuller” trajectory, increase the sampling rate or use an arc interpolator; in any case, the nodes remain exactly on the geometric locus.

Why \(\pi\) is not needed

\(\pi\) is needed when you measure the arc (lengths, areas, times along an arc). In GRG we do not measure the arc: we enforce the distance from the center and the direction. Therefore \(\pi\) is irrelevant to guarantee that points lie on a circle/sphere. You may use \(\pi\) later if you care about arc length, but not to construct the point.

Natural extension to the sphere (including the \(Z\) axis)

What holds in \(X\!-\!Y\) holds in \(X\!-\!Y\!-\!Z\). A unit direction in 3D (obtained via Cartesian projections, without “walking on the surface”) is scaled by \(R\). The result has norm \(R\). That is all. Azimuth–elevation formulas are just a convenient way to obtain \((x,y,z)\). The key property remains the preservation of distance.

Practical consequences for robotics, CNC, and 3D printers

If your machine moves on Cartesian axes and you command \((x,y)\) (or \((x,y,z)\)) according to the GRG law, the ideal path is exactly the circumference (or the sphere).

Any deviations you might measure on a real part come from mechanics and numerics: backlash, compliance, calibration, friction, quantization. Improve the machine, the controller, and the metrology, and you approach the ideal without changing the GRG law.

Typical objections, short answers

  • “Without \(\pi\) I cannot make a circle.” False: a circle is the locus of points at distance \(R\) from a center. No \(\pi\) is needed to guarantee that distance.
  • “Sine and cosine are approximate numeric functions.” In geometry they are exact ratios; in control you can use incremental orthogonal rotations that preserve the norm by construction.
  • “Steps accumulate error.” Rotations do not change the norm. In digital control, rounding errors are contained with renormalization or periodic recomputation.
  • “Points on the sphere are not uniformly distributed.” Different topic: sampling uniformity does not affect the fact that each point lies on the sphere.

The key takeaway

GRG does not approximate the circle or the sphere: it imposes them. With a radius \(R\) fixed and a direction chosen, the distance from the center is \(R\) by construction: therefore the point is certainly on the circumference (or on the sphere). In a Cartesian system, the geometric precision of the trajectory does not depend on \(\pi\) nor on arc approximations: it depends only on your machine and numerics.

Certainly on the Circumference — and the Sphere

Category: Rigor of GRG

GRG conventions. Angles in turns \(u\in[0,1)\) with step \(\Delta u=1/N\). Radial computations (perimeter & radial area) on the full turn; Cartesian area on the quarter (×4). Trig appears only as classical cross-check.

Certainly on the Circumference

  • Circle \(R\): \(x^2+y^2=R^2\).

  • Direction (turns): \(u\in[0,1)\) → radial pose (no arc lengths).

  • GRG border: certificate \(x(u)^2+y(u)^2=R^2\) (Pythagoras on quarter or tangent intersections on turn).

Classical (optional): with \(\varphi=2\pi u\): \(x=R\cos\varphi,\ y=R\sin\varphi\).

Theorem

Every GRG point \(P(u)\) satisfies \(x(u)^2+y(u)^2=R^2\) ⇒ it lies on the circle.

Fig. — Radial construction / orthogonal update preserves norm.

Certainly on the Sphere

  • Sphere \(R\): \(x^2+y^2+z^2=R^2\).

  • Unit direction: build \(\mathbf{u}\) constructively; \(\mathbf{P}=R\,\mathbf{u}\) certifies \(\|\mathbf{P}\|=R\).

Classical (optional): \((\varphi,\theta)\) → \(x=R\cos\varphi\,\sin\theta,\ y=R\sin\varphi\,\sin\theta,\ z=R\cos\theta\).

Theorem

\(\|R\,\mathbf{u}\|^2=R^2\|\mathbf{u}\|^2=R^2\) ⇒ point on the sphere.

Fig. — 3D orthogonal rotations preserve the norm.

GRG · Operative summary (turns & quarter)

Params. Pick \(N\). Full turn: \(u_j=j/N\) with \(\Delta u=1/N\). Generate \(P_j=(x_j,y_j)\) with \(x_j^2+y_j^2=R^2\). Quarter: \(\Delta x=R/N\).

Perimeter — full turn (radial)

Inscribed (lower)

\[ L_{\mathrm{in}}(N)=\sum_{j=0}^{N-1}\sqrt{(x_{j+1}-x_j)^2+(y_{j+1}-y_j)^2}. \]

Circumscribed (upper) — tangents at \(P_j\): \(x\,x_j+y\,y_j=R^2\); intersections \(T_j\) with \(\det_j=x_jy_{j+1}-y_jx_{j+1}\), \(T_j^x=\frac{R^2(y_{j+1}-y_j)}{\det_j}\), \(T_j^y=\frac{R^2(x_j-x_{j+1})}{\det_j}\).

\[ L_{\mathrm{out}}(N)=\sum_{j=0}^{N-1}\lVert T_{j+1}-T_j\rVert. \]

Radial area — full turn

\[ A_{\mathrm{in}}(N)=\tfrac12\sum_{j=0}^{N-1}(x_jy_{j+1}-x_{j+1}y_j),\qquad A_{\mathrm{out}}(N)=\tfrac12\sum_{j=0}^{N-1}(T_j^xT_{j+1}^y-T_{j+1}^xT_j^y). \]

Cartesian area — quarter (Δx) → ×4

Abscissas \(x_i=i\Delta x\), \(\Delta x=R/N\); heights \(y_i=\sqrt{R^2-(i\Delta x)^2}\).

\[ A_{\mathrm{right,q}}=\sum_{i=1}^{N}y_i\Delta x,\quad A_{\mathrm{mid,q}}=\sum_{i=1}^{N}y\!\left(x_{i-\tfrac12}\right)\Delta x,\quad A_{\mathrm{trap,q}}=\sum_{i=1}^{N}\tfrac{y_{i-1}+y_i}{2}\Delta x. \]

Bounds: \(A_{\mathrm{right,q}}\le A_{\mathrm{quarter}}\le A_{\mathrm{mid,q}}\); disk via ×4. π remains outside the computation; trig only as cross-check.

ERG Cartesian

ERG Cartesian

ERG Cartesian — Quarter Chords to Sphere (GRG)

From a quarter construction we derive circumference, sphere surface and volume using discrete, angle-free operators. All figures below are drawn in a strict Cartesian frame (linear x–z axes, equal scale).

Quarter circumference (equal-angle chords)

For a radius $\rho$, divide the $90^\circ$ arc into $N$ equal angles. Replace each arc step with a chord. The discrete GRG quarter circumference is:

$$ C_{1/4}^{\mathrm{GRG}}(\rho;N)=2\,N\,\rho\,\sin\!\Bigl(\tfrac{45^\circ}{N}\Bigr) \;=\;2\,N\,\rho\,s\!\Bigl(\tfrac{1}{8N}\Bigr). $$
Quarter arc with equal-angle chords — strict Cartesian Axes and a true quarter circle of radius 100; chords join consecutive points at 15° steps (N=6). Coordinates are (x=ρ cosθ, z=ρ sinθ). xz
Equal-angle chords on a true quarter circle (example $N=6$). Axes and lengths are Cartesian.

Quarter section → sphere surface (horizontal slices + quarter chords)

Slice the sphere horizontally into $N$ levels of thickness $\Delta z=\tfrac{r}{N}$. At level $k$:

$$ z_k=\frac{k}{N}\,r, \qquad \rho_k=\sqrt{\,r^2-z_k^2\,}, \qquad S_{1/8}(N)=\sum_{k=1}^{N} C_{1/4}^{\mathrm{GRG}}(\rho_k;N)\,\frac{r}{N},\quad S(N)=8\,S_{1/8}(N). $$
Unwrapped surface S1/8(N) — strict Cartesian Bars of constant height Δz with width proportional to ρ_k (and hence to C_{1/4}^{GRG}(ρ_k;N) for fixed N). Axes are linear. local width ∝ ρk z
Area under the bars equals $S_{1/8}(N)$ up to the constant factor $2N\,s(\tfrac{1}{8N})$ common to all strips for fixed $N$.

Quarter area and sphere volume (stack quarter areas)

Quarter area for radius $\rho$ (base split into $N$ parts; rectangles on circle heights), and octant volume via the same $\Delta z$:

$$ A_{1/4}^{\mathrm{GRG}}(\rho;N)=\sum_{i=1}^{N}\Bigl(\tfrac{\rho}{N}\Bigr)\sqrt{\,\rho^{2}-\Bigl(\tfrac{i\,\rho}{N}\Bigr)^{2}\,}, \qquad V_{1/8}(N)=\sum_{k=1}^{N} A_{1/4}^{\mathrm{GRG}}(\rho_k;N)\,\tfrac{r}{N},\quad V(N)=8\,V_{1/8}(N). $$
Octant volume from stacked quarter-disk slabs — strict Cartesian Quarter disks of radii ρ_k = sqrt(r^2 - z_k^2) stacked along z; each slab has thickness Δz. x z
Stacking quarter-disk slabs of radius $\rho_k$ (Cartesian x–z plane). The sum of their quarter areas times $\Delta z$ gives $V_{1/8}(N)$.

ERG — Original Projection (Cartesian)

$$ \Delta x=\frac{r}{N},\quad x_k=k\,\Delta x,\quad x_{k+\tfrac12}=\Bigl(k+\tfrac12\Bigr)\Delta x,\quad y(x)=\sqrt{\,r^{2}-x^{2}\,}. $$
$$ A_{\text{quarter, mid}}(N)=\sum_{k=0}^{N-1} y\!\bigl(x_{k+\tfrac12}\bigr)\,\Delta x,\qquad A_{\text{quarter, right}}(N)=\sum_{k=0}^{N-1} y\!\bigl(x_{k+1}\bigr)\,\Delta x. $$

Below: true Cartesian rectangles for $r=100$, $N=5$ (so $\Delta x=20$). Heights are exactly $y=\sqrt{r^2-x^2}$ at the mid/right samples.

Quarter — midpoint (upper) vs right-endpoint (lower), strict Cartesian Quarter circle r=100. Δx=20. Green bars at x_mid = (k+1/2)Δx with exact heights sqrt(r^2 - x_mid^2). Orange outlines at right endpoints x=(k+1)Δx. x y
Midpoint (filled, upper) vs right-endpoint (outlined, lower) — heights computed from $y=\sqrt{r^2-x^2}$ with $r=100$, $\Delta x=20$.