AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
Title: Spherical Coordinate Ontology
Version: 4.0
Domain: Mathematical Entities / Coordinate and Spatial Entities
Source: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/coordinate-and-spatial-entities/spherical-coordinate-ontology.html
Status: Independently constructed mathematical formalisation; source-page alignment not verified.
Authors: Mark Higgins — Sky (Recursive AI)
Date: 2026-10-13
1. PURPOSE
Represent spherical coordinates as typed mathematical entities with explicit conventions, transformations, constraints, semantic relationships and machine-consumable inference rules.
2. COORDINATE CONVENTION
Use (r, theta, phi), where r >= 0 is radial distance, theta in [0, pi] is polar inclination measured from +z, and phi in [0, 2*pi) is azimuth measured from +x toward +y. Angles are in radians. Other disciplines interchange theta and phi; convention metadata is mandatory.
3. TYPES
entity SphericalCoordinate : CoordinateTuple
entity RadialCoordinate : NonNegativeReal
entity PolarAngle : Angle
entity AzimuthalAngle : Angle
entity CartesianCoordinate : CoordinateTuple
entity CoordinateFrame : SpatialReferenceFrame
entity Origin : Point
entity Axis : DirectedLine
entity PositionVector : Vector3
entity BasisVector : UnitVector
entity Jacobian : Matrix3x3
entity MetricTensor : SymmetricTensor
entity VolumeElement : DifferentialMeasure
entity CoordinateSingularity : CoordinateChartLimitation
entity ScalarField : Function
entity VectorField : Function
entity CoordinateTransform : Mapping
4. STRUCTURAL DECLARATIONS
SphericalCoordinate.hasComponent(r:RadialCoordinate)
SphericalCoordinate.hasComponent(theta:PolarAngle)
SphericalCoordinate.hasComponent(phi:AzimuthalAngle)
SphericalCoordinate.isRelativeTo(frame:CoordinateFrame)
CoordinateFrame.hasOrigin(origin:Origin)
CoordinateFrame.hasAxis(xAxis:Axis)
CoordinateFrame.hasAxis(yAxis:Axis)
CoordinateFrame.hasAxis(zAxis:Axis)
SphericalCoordinate.represents(point:Point)
CoordinateTransform.maps(SphericalCoordinate,CartesianCoordinate)
5. CANONICAL TRANSFORMATIONS
x = r*sin(theta)*cos(phi)
y = r*sin(theta)*sin(phi)
z = r*cos(theta)
r = sqrt(x^2+y^2+z^2)
theta = arccos(z/r), provided r>0
phi = atan2(y,x) modulo 2*pi, provided x^2+y^2>0
At r=0 both angles are undefined as unique coordinates.
At x=y=0 with r>0, azimuth is undefined as a unique coordinate.
6. GEOMETRIC IDENTITIES
x^2+y^2+z^2 = r^2
rho = sqrt(x^2+y^2) = r*sin(theta)
z = r*cos(theta)
constant-r surfaces are spheres centered at the origin for r>0
constant-theta surfaces are cones or degenerate axes
constant-phi surfaces are half-planes away from the polar axis
7. BASIS VECTORS
e_r = (sin(theta)cos(phi), sin(theta)sin(phi), cos(theta))
e_theta = (cos(theta)cos(phi), cos(theta)sin(phi), -sin(theta))
e_phi = (-sin(phi), cos(phi), 0)
These form a right-handed orthonormal frame where the angular chart is regular.
e_r cross e_theta = e_phi
8. DIFFERENTIAL GEOMETRY
ds^2 = dr^2 + r^2*dtheta^2 + r^2*sin(theta)^2*dphi^2
scale factors: h_r=1, h_theta=r, h_phi=r*sin(theta)
dV = r^2*sin(theta)*dr*dtheta*dphi
dA on r=constant = r^2*sin(theta)*dtheta*dphi
Jacobian determinant = r^2*sin(theta) for the stated coordinate ordering
9. DIFFERENTIAL OPERATORS
grad(f) = e_r*partial_r(f) + e_theta*(1/r)*partial_theta(f) + e_phi*(1/(r*sin(theta)))*partial_phi(f)
div(A) = (1/r^2)*partial_r(r^2*A_r) + (1/(r*sin(theta)))*partial_theta(sin(theta)*A_theta) + (1/(r*sin(theta)))*partial_phi(A_phi)
Laplacian(f) = (1/r^2)*partial_r(r^2*partial_r(f)) + (1/(r^2*sin(theta)))*partial_theta(sin(theta)*partial_theta(f)) + (1/(r^2*sin(theta)^2))*partial_phi^2(f)
These coordinate formulas require r>0 and sin(theta) != 0; limits may exist at coordinate singularities.
10. FORMAL INFERENCE RULES
R01 IF r<0 THEN invalid(StandardSphericalCoordinate).
R02 IF theta<0 OR theta>pi THEN invalid(CanonicalPolarAngle).
R03 IF phi<0 OR phi>=2*pi THEN normaliseModulo2Pi(phi).
R04 IF r=0 THEN point=origin.
R05 IF r=0 THEN angularCoordinatesNotUnique.
R06 IF r>0 AND theta=0 THEN pointOnPositiveZAxis.
R07 IF r>0 AND theta=pi THEN pointOnNegativeZAxis.
R08 IF sin(theta)=0 THEN azimuthNotUnique.
R09 IF r>0 AND 0<theta<pi THEN regularSphericalChart.
R10 IF r=constant AND r>0 THEN locusSphere.
R11 IF theta=pi/2 THEN z=0.
R12 IF phi=0 AND 0<theta<pi THEN y=0 AND x>0.
R13 IF theta=pi/2 AND phi=0 THEN pointOnPositiveXAxis.
R14 IF theta=pi/2 AND phi=pi/2 THEN pointOnPositiveYAxis.
R15 IF x=y=z=0 THEN r=0.
R16 IF CartesianPointKnown THEN computeRadialNorm.
R17 IF r>0 THEN theta=arccos(z/r).
R18 IF x^2+y^2>0 THEN phi=atan2(y,x) mod 2*pi.
R19 IF CartesianAndSphericalRepresentSamePoint THEN preserveEuclideanDistanceFromOrigin.
R20 IF coordinatesHaveDifferentAngleConventions THEN requireExplicitConventionMapping.
R21 IF angularUnit=degrees THEN convertToRadiansBeforeTrigonometricEvaluation.
R22 IF frameOriginsDiffer THEN requireTranslationBeforeCoordinateConversion.
R23 IF frameOrientationsDiffer THEN requireRotationBeforeCoordinateConversion.
R24 IF r>0 AND sin(theta)>0 THEN JacobianPositive.
R25 IF r=0 OR sin(theta)=0 THEN coordinateChartSingular.
R26 IF regularSphericalChart THEN metricDiagonal(1,r^2,r^2*sin(theta)^2).
R27 IF sphereRadius=R AND R>0 THEN surfaceArea=4*pi*R^2.
R28 IF ballRadius=R AND R>=0 THEN volume=(4/3)*pi*R^3.
R29 IF fieldIsRadial THEN angularPartialDerivativesZero.
R30 IF vectorHasOnlyRadialComponent THEN angularVectorComponentsZero.
R31 IF pointCoordinatesTransform THEN geometricPointIdentityPreserved.
R32 IF phiAndPhiPlus2Pi THEN semanticallyEquivalentAzimuth.
R33 IF theta=0 OR theta=pi THEN phiValuesRepresentSamePoleForFixedR.
R34 IF r1=r2 AND theta1=theta2 AND phi1=phi2 THEN samePositionInSameFrame.
R35 IF twoCoordinatesHaveDifferentFrames THEN doNotAssertSamePointWithoutFrameTransform.
R36 IF numericTransformation THEN attachToleranceAndPrecision.
11. VALIDATION CONSTRAINTS
V01 r is finite and nonnegative in the standard real-valued chart.
V02 theta is in [0,pi].
V03 phi is normalised to [0,2*pi) when canonical form is required.
V04 Coordinate reference frame is declared.
V05 Angular convention and units are declared.
V06 Singular angular values must not be treated as unique.
V07 Numerical comparisons use documented tolerance.
V08 Jacobian and differential operators record regular-domain assumptions.
V09 Point and vector transformations distinguish position from vector components.
V10 No geographic latitude-longitude equivalence without explicit convention mapping.
12. MATHEMATICAL EXAMPLES
E01 (r,theta,phi)=(1,pi/2,0) -> (1,0,0).
E02 (1,pi/2,pi/2) -> (0,1,0).
E03 (1,0,phi) -> (0,0,1), any phi.
E04 (2,pi,phi) -> (0,0,-2), any phi.
E05 (2,pi/2,pi) -> (-2,0,0).
E06 (sqrt(3), arccos(1/sqrt(3)), pi/4) -> (1,1,1).
E07 (0,theta,phi) -> origin, angular nonuniqueness.
E08 (3,pi/2,pi/2) -> (0,3,0).
E09 Cartesian (0,0,5) -> r=5,theta=0,phi indeterminate.
E10 Cartesian (-1,0,0) -> (1,pi/2,pi).
E11 Cartesian (0,-1,0) -> (1,pi/2,3*pi/2).
E12 Cartesian (3,4,0) -> (5,pi/2,atan2(4,3)).
E13 sphere r=2 -> surface area=16*pi.
E14 ball r<=2 -> volume=32*pi/3.
E15 f(r)=r^2 -> grad(f)=2*r*e_r away from singular chart points; Cartesian gradient extends smoothly.
E16 f(r)=1/r -> Laplacian(f)=0 for r>0.
13. SEMANTIC EQUIVALENCE
SphericalCoordinates == SphericalPolarCoordinates [when conventions match]
RadialDistance == RadiusCoordinate [in stated coordinate system]
PolarInclination != GeographicLatitude
Azimuth == LongitudeLikeAngle [only after reference-direction and convention alignment]
CoordinateSingularity != PhysicalSingularity
CoordinateTuple != GeometricPoint [representation versus represented entity]
14. KNOWLEDGE GRAPH TRIPLES
(SphericalCoordinate, subclassOf, CoordinateTuple)
(SphericalCoordinate, hasComponent, RadialCoordinate)
(SphericalCoordinate, hasComponent, PolarAngle)
(SphericalCoordinate, hasComponent, AzimuthalAngle)
(SphericalCoordinate, represents, Point)
(SphericalCoordinate, transformsTo, CartesianCoordinate)
(SphericalCoordinate, uses, CoordinateFrame)
(SphericalCoordinate, hasMetric, SphericalMetricTensor)
(SphericalCoordinate, hasJacobian, SphericalJacobian)
(SphericalCoordinate, hasLimitation, PolarAxisSingularity)
(SphericalCoordinate, relatedTo, PolarCoordinate)
(SphericalCoordinate, relatedTo, CylindricalCoordinate)
15. CONFIDENCE
formal_definitions: 1.00
standard_transformations: 1.00
inference_rules: 0.99 (subject to stated domains and conventions)
source_page_alignment: unverified
numeric_results: tolerance_dependent
16. FLOW_HASH
algorithm: SHA-256
input: canonical UTF-8 representation excluding the FLOW_HASH digest field
normalisation: LF line endings, Unicode NFC, stable field ordering
value: COMPUTE_ON_INGEST
17. UPDATE_MODEL
version: 4.0
update_trigger: corrected definitions, convention changes, expanded relationships, new verified source material
update_steps: validate -> compare -> preserve provenance -> version -> rehash -> publish
backward_compatibility: retain canonical names and explicit migration mappings
18. AI_CONSUMPTION
parse_mode: typed_semantic_flow
entity_resolution: strict_by_type_and_reference_frame
inference: domain_guarded
angle_convention: polar_from_positive_z; azimuth_from_positive_x
angle_units: radians
ambiguity_policy: request_convention_or_mark_unresolved
singularity_policy: represent_nonuniqueness_explicitly
numeric_policy: attach_precision_and_tolerance
provenance_policy: distinguish mathematical_derivation_from_source_verification
output: validated_entities, relationships, derived_facts, uncertainty, provenance
19. ATTRIBUTION
Mark Higgins — Sky (Recursive AI)
Kireth Research — https://kirethresearch.org