Earth’s Cities on a Sphere: Random Points and Nearest-Point Vectors
Loading the math board and drawing, please wait…
In collections
Earth and Sun
This example visualizes how points sampled on (or inside) a 3D sphere relate to a set of “city” points by repeatedly finding the closest city for each sampled location and representing the result geometrically. It demonstrates spherical/solid geometry using a globe-like sphere, spatial point coordinates, and the nearest-point concept (shortest distance via closest point). It also incorporates list/sequence handling by building a generated set of random (or discrete) points and then using indexing to identify which city is nearest. Construction focuses on: Sphere to create the spherical Earth model; PointIn to place points in the spherical region; Sequence to generate and iterate through the sampled point set; ClosestPoint to compute the nearest city point; and IndexOf to retrieve the index of that city from the stored list, enabling consistent labeling/highlighting and vector-based visualization. Suitable for secondary school to early university courses in solid geometry, coordinate geometry, and probability & statistics using random experiments, as well as for STEM visualization projects.
GeoGebra Commands & Parameters
Sphere((0, 0, 0), (0.999 * 5)) → tierraPointIn(tierra) → ASequence((5; (cities(k, 3))°; (cities(k, 4))°), k, 1, Length[cities]) → cercanosClosestPoint(cercanos, A) → CercanoAIndexOf(CercanoA, cercanos) → indiceCercaA
AI Drawing Prompt Reference
Create a 3D sphere centered at (0,0,0) with radius about 0.999×5 to represent the Earth. Place a point inside the spherical region as location A. Define a discrete list of “city” points in 3D coordinates. For each sampled city point, determine which city is the closest to A using the nearest-point (shortest distance) idea, then highlight/display the nearest city point relative to A. Also annotate the index of this nearest city within the stored city-point set so the highlighted point is identifiable.
The prompt above was compiled from the original drawing commands and is for reference only.