Transformers
K-Dense-AI/scientific-agent-skills
Hugging Face Transformers for loading Hub models, running pipeline inference, text generation, and Trainer fine-tuning on NLP, vision, audio, and multimodal tasks.
CesiumJS spatial math - Cartesian3, Cartographic, Matrix4, Quaternion, Transforms, Ellipsoid, BoundingSphere, projections, coordinate conversions.
$ npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-spatial-math -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install CesiumGS/cesiumjs-skills cesiumjs-spatial-math --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/CesiumGS/cesiumjs-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cesiumjs-spatial-math .claude/skills/cesiumjs-spatial-math && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "cesiumjs-spatial-math" agent skill from https://github.com/CesiumGS/cesiumjs-skills/tree/main/skills/cesiumjs-spatial-math into .claude/skills/cesiumjs-spatial-math/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cesiumjs-spatial-math", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/CesiumGS/cesiumjs-skills/tree/main/skills/cesiumjs-spatial-mathType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-spatial-math -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install CesiumGS/cesiumjs-skills cesiumjs-spatial-math --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/CesiumGS/cesiumjs-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/cesiumjs-spatial-math .agents/skills/cesiumjs-spatial-math && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "cesiumjs-spatial-math" agent skill from https://github.com/CesiumGS/cesiumjs-skills/tree/main/skills/cesiumjs-spatial-math into .agents/skills/cesiumjs-spatial-math/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cesiumjs-spatial-math", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-spatial-math -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install CesiumGS/cesiumjs-skills cesiumjs-spatial-math --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/CesiumGS/cesiumjs-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/cesiumjs-spatial-math .cursor/skills/cesiumjs-spatial-math && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "cesiumjs-spatial-math" agent skill from https://github.com/CesiumGS/cesiumjs-skills/tree/main/skills/cesiumjs-spatial-math into .cursor/skills/cesiumjs-spatial-math/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cesiumjs-spatial-math", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/CesiumGS/cesiumjs-skills.git --path skills/cesiumjs-spatial-math--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-spatial-math -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install CesiumGS/cesiumjs-skills cesiumjs-spatial-math --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/CesiumGS/cesiumjs-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/cesiumjs-spatial-math .gemini/skills/cesiumjs-spatial-math && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "cesiumjs-spatial-math" agent skill from https://github.com/CesiumGS/cesiumjs-skills/tree/main/skills/cesiumjs-spatial-math into .gemini/skills/cesiumjs-spatial-math/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cesiumjs-spatial-math", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install CesiumGS/cesiumjs-skills cesiumjs-spatial-mathInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-spatial-math -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/CesiumGS/cesiumjs-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/cesiumjs-spatial-math .github/skills/cesiumjs-spatial-math && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "cesiumjs-spatial-math" agent skill from https://github.com/CesiumGS/cesiumjs-skills/tree/main/skills/cesiumjs-spatial-math into .github/skills/cesiumjs-spatial-math/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cesiumjs-spatial-math", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-spatial-math -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install CesiumGS/cesiumjs-skills cesiumjs-spatial-math --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/CesiumGS/cesiumjs-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/cesiumjs-spatial-math .opencode/skills/cesiumjs-spatial-math && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "cesiumjs-spatial-math" agent skill from https://github.com/CesiumGS/cesiumjs-skills/tree/main/skills/cesiumjs-spatial-math into .opencode/skills/cesiumjs-spatial-math/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cesiumjs-spatial-math", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
cesiumjs-spatial-mathCesiumJS spatial math - Cartesian3, Cartographic, Matrix4, Quaternion, Transforms, Ellipsoid, BoundingSphere, projections, coordinate conversions.
Cesiumjs Spatial Math is an agent skill from CesiumGS/cesiumjs-skills. CesiumJS spatial math - Cartesian3, Cartographic, Matrix4, Quaternion, Transforms, Ellipsoid, BoundingSphere, projections, coordinate conversions. Use when converting between coordinate systems, computing positions on the ellipsoid, performing spatial intersection tests, building model matrices, or working with geographic projections.
Its SKILL.md is about 4.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
The repository describes itself as: Curated agent skills for CesiumJS development. The licence is Apache-2.0.
10 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 5f4792c. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Cesiumjs Spatial Math loads about 4.6k tokens when it runs. Until then it costs about 90 tokens; SKILL.md has 687 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from CesiumGS/cesiumjs-skills at commit 5f4792c, republished under its Apache-2.0 licence (© CesiumGS). 687 words, ~4,572 tokens.
.claude/skills/cesiumjs-spatial-math/SKILL.md (or your agent's skills folder).Version baseline: CesiumJS v1.144 (2026-08-01)
Mathematical foundation for every CesiumJS application: coordinate types, unit conversions, ellipsoid geometry, reference frame transforms, bounding volumes, intersection tests, and projections.
CesiumJS uses a right-handed Earth-Centered Earth-Fixed (ECEF) coordinate system:
All angular values in core math are radians. Use Math.toRadians() / Math.toDegrees(). Math types use a static-method-with-result pattern: pass a result parameter to reuse allocations.
import { Cartesian3, Math as CesiumMath } from "cesium";
// From lon/lat degrees -- most common entry point
const pos = Cartesian3.fromDegrees(-105.0, 40.0);
const elevated = Cartesian3.fromDegrees(-105.0, 40.0, 1500.0); // with height
// Batch creation: [lon, lat, lon, lat, ...]
const ring = Cartesian3.fromDegreesArray([-105, 40, -100, 40, -100, 35]);
// With heights: [lon, lat, h, lon, lat, h, ...]
const wall = Cartesian3.fromDegreesArrayHeights([-105, 40, 500, -100, 40, 1000]);
// From raw ECEF or from radians
const raw = new Cartesian3(-1275096.0, -4797180.0, 4075270.0);
const fromRad = Cartesian3.fromRadians(-1.8326, 0.6981, 1500.0);
// Constants
Cartesian3.ZERO; // (0,0,0)
Cartesian3.UNIT_X; // (1,0,0)
Cartesian3.UNIT_Y; // (0,1,0)
Cartesian3.UNIT_Z; // (0,0,1)Breaking change (1.139, #8359):
Cartesian2,Cartesian3, andCartesian4are now ES6 classes. Callingnewon a static factory method now throws --new Cartesian3.fromArray([...])andnew Cartesian3.fromDegrees(...)are errors. Dropnewfor factory methods (Cartesian3.fromArray([...])); keep it only for the real constructor (new Cartesian3(x, y, z)). More classes are migrating to ES6 classes, so apply this rule everywhere.
const a = new Cartesian3(1.0, 2.0, 3.0);
const b = new Cartesian3(4.0, 5.0, 6.0);
const r = new Cartesian3(); // reusable scratch
Cartesian3.add(a, b, r); // a + b
Cartesian3.subtract(a, b, r); // a - b
Cartesian3.multiplyByScalar(a, 2.0, r); // a * 2
Cartesian3.negate(a, r); // -a
Cartesian3.cross(a, b, r); // cross product
Cartesian3.normalize(a, r); // unit vector
Cartesian3.lerp(a, b, 0.5, r); // linear interpolation
Cartesian3.midpoint(a, b, r); // midpoint
const dot = Cartesian3.dot(a, b); // dot product
const len = Cartesian3.magnitude(a); // ||a||
const dist = Cartesian3.distance(a, b); // Euclidean distance
const distSq = Cartesian3.distanceSquared(a, b); // faster for comparisons
const angle = Cartesian3.angleBetween(a, b); // radiansimport { Cartographic, Cartesian3, Math as CesiumMath } from "cesium";
const carto = Cartographic.fromDegrees(-105.0, 40.0, 1500.0);
const cartoRad = Cartographic.fromRadians(-1.8326, 0.6981, 1500.0);
// Cartesian3 <-> Cartographic
const position = Cartesian3.fromDegrees(-105.0, 40.0, 1500.0);
const geo = Cartographic.fromCartesian(position);
const lonDeg = CesiumMath.toDegrees(geo.longitude); // -105.0
const latDeg = CesiumMath.toDegrees(geo.latitude); // 40.0
const backToCart = Cartographic.toCartesian(geo);import { Math as CesiumMath } from "cesium";
// Degree/radian conversion
const rad = CesiumMath.toRadians(90.0); // PI/2
const deg = CesiumMath.toDegrees(Math.PI); // 180
// Constants: PI, TWO_PI, PI_OVER_TWO, PI_OVER_FOUR, RADIANS_PER_DEGREE
// EPSILON1 (0.1) through EPSILON21 (1e-21)
const clamped = CesiumMath.clamp(value, 0.0, 1.0);
const interp = CesiumMath.lerp(0.0, 100.0, 0.5); // 50
const norm = CesiumMath.negativePiToPi(angle); // [-PI, PI]
const pos = CesiumMath.zeroToTwoPi(angle); // [0, 2*PI]
const safeLon = CesiumMath.convertLongitudeRange(angle); // [-PI, PI)
const eq = CesiumMath.equalsEpsilon(a, b, CesiumMath.EPSILON7); // float compareimport { Ellipsoid, Cartesian3, Cartographic } from "cesium";
// Built-in ellipsoids
Ellipsoid.WGS84; // Earth (default)
Ellipsoid.UNIT_SPHERE; // radius 1
Ellipsoid.MOON; // lunar sphere
Ellipsoid.MARS; // Mars (v1.133+)
// Change default (affects Ellipsoid.default everywhere)
Ellipsoid.default = Ellipsoid.MOON;
// Conversions on a specific ellipsoid
const cart = Ellipsoid.WGS84.cartographicToCartesian(
Cartographic.fromDegrees(-75.0, 40.0, 100.0),
);
const carto = Ellipsoid.WGS84.cartesianToCartographic(cart);
// Surface normal at a position
const normal = Ellipsoid.WGS84.geodeticSurfaceNormal(cart, new Cartesian3());
// Project point onto ellipsoid surface
const onSurface = Ellipsoid.WGS84.scaleToGeodeticSurface(cart, new Cartesian3());Transforms builds 4x4 matrices relating local frames to ECEF. The most commonly used function is eastNorthUpToFixedFrame.
ENU: X = east, Y = north, Z = up. Standard frame for placing models on the globe.
import { Cartesian3, Transforms, Matrix4 } from "cesium";
const origin = Cartesian3.fromDegrees(-105.0, 40.0);
const enuMatrix = Transforms.eastNorthUpToFixedFrame(origin);
// Columns: [east, north, up, origin] in ECEFStandard way to position and orient a 3D model.
import { Cartesian3, Transforms, HeadingPitchRoll, Math as CesiumMath } from "cesium";
const position = Cartesian3.fromDegrees(-105.0, 40.0, 0.0);
const hpr = new HeadingPitchRoll(
CesiumMath.toRadians(90.0), // heading: 90 deg east
0.0, // pitch: level
0.0, // roll: none
);
const modelMatrix = Transforms.headingPitchRollToFixedFrame(position, hpr);
// Just the orientation quaternion (e.g., for Entity.orientation)
const orientation = Transforms.headingPitchRollQuaternion(position, hpr);Heading = rotation about -Z (compass bearing, clockwise). Pitch = about -Y. Roll = about +X. Radians.
import { HeadingPitchRoll, Math as CesiumMath } from "cesium";
const hpr = new HeadingPitchRoll(CesiumMath.toRadians(45.0), CesiumMath.toRadians(-10.0), 0.0);
const hprDeg = HeadingPitchRoll.fromDegrees(45.0, -10.0, 0.0); // convenienceimport { Transforms, Cartesian3 } from "cesium";
const origin = Cartesian3.fromDegrees(-105.0, 40.0);
Transforms.northEastDownToFixedFrame(origin); // NED (aviation)
Transforms.northUpEastToFixedFrame(origin); // NUE
// Custom frame from any combo of east|north|up|west|south|down
const customFn = Transforms.localFrameToFixedFrameGenerator("north", "west");
const matrix = customFn(origin);
// Recover heading/pitch/roll from an existing model matrix
const hpr = Transforms.fixedFrameToHeadingPitchRoll(modelMatrix);Column-major storage (WebGL convention). Constructor takes row-major for readability.
import { Matrix4, Matrix3, Cartesian3, Quaternion } from "cesium";
// Factory methods
Matrix4.fromTranslation(new Cartesian3(10, 20, 30));
Matrix4.fromRotationTranslation(Matrix3.fromRotationZ(Math.PI / 4), new Cartesian3(100, 0, 0));
Matrix4.fromTranslationQuaternionRotationScale(
new Cartesian3(0, 0, 0), Quaternion.IDENTITY, new Cartesian3(2, 2, 2),
);
Matrix4.fromUniformScale(5.0);
// Combine, transform, invert
const combined = Matrix4.multiply(matA, matB, new Matrix4());
const worldPt = Matrix4.multiplyByPoint(enuMatrix, new Cartesian3(100, 0, 0), new Cartesian3());
const inv = Matrix4.inverseTransformation(enuMatrix, new Matrix4()); // rigid-body only
// Decompose
Matrix4.getTranslation(enuMatrix, new Cartesian3());
Matrix4.getMatrix3(enuMatrix, new Matrix3());
Matrix4.getScale(enuMatrix, new Cartesian3());import { Quaternion, Cartesian3, HeadingPitchRoll, Math as CesiumMath, Matrix3, Matrix4, Transforms } from "cesium";
Quaternion.IDENTITY; // (0, 0, 0, 1)
const q1 = Quaternion.fromAxisAngle(Cartesian3.UNIT_Z, CesiumMath.toRadians(45.0));
const q2 = Quaternion.fromHeadingPitchRoll(new HeadingPitchRoll(CesiumMath.toRadians(90), 0, 0));
const q3 = Quaternion.fromRotationMatrix(Matrix3.fromRotationZ(Math.PI / 2));
const mid = Quaternion.slerp(q1, q2, 0.5, new Quaternion()); // interpolate
const composed = Quaternion.multiply(q1, q2, new Quaternion()); // composeUse this pattern when you need explicit axis-angle control over model orientation, then must compose with an ENU local frame:
import { Cartesian3, Quaternion, Matrix3, Matrix4, Transforms, Math as CesiumMath } from "cesium";
const origin = Cartesian3.fromDegrees(-115.17, 36.11, 3000.0);
// 1. Build local-to-ECEF frame at origin
const enuFrame = Transforms.eastNorthUpToFixedFrame(origin);
// 2. Build quaternion for 45-deg yaw about local up axis
const q = Quaternion.fromAxisAngle(Cartesian3.UNIT_Z, CesiumMath.toRadians(45.0));
// 3. Convert quaternion → Matrix3 → Matrix4 (zero translation in local frame)
const rot3 = Matrix3.fromQuaternion(q, new Matrix3());
const rotMatrix4 = Matrix4.fromRotationTranslation(rot3, Cartesian3.ZERO, new Matrix4());
// 4. Compose: ENU frame * local rotation = final model matrix
const modelMatrix = Matrix4.multiply(enuFrame, rotMatrix4, new Matrix4());This is the canonical pattern for placing a model with arbitrary rotation at a geographic position. Transforms.headingPitchRollToFixedFrame is a convenience wrapper for HPR rotations; use the manual composition above when you need axis-angle or quaternion control.
Critical: "Distance between two lon/lat points" almost always means great-circle surface distance, not the straight-line chord through the Earth. Using Cartesian3.distance on two fromDegrees results gives the chord, which is shorter than the surface distance and grows materially wrong over continental scales (e.g., NYC↔London chord is ~100+ km off the ~5,837 km surface distance). Always use EllipsoidGeodesic.surfaceDistance for "how far apart are these two places" labels.
import { Cartographic, EllipsoidGeodesic, Cartesian3 } from "cesium";
// Surface distance (great-circle via Vincenty) -- correct for "distance between cities"
const geodesic = new EllipsoidGeodesic(
Cartographic.fromDegrees(-73.985, 40.758), // New York
Cartographic.fromDegrees(-0.1276, 51.5074), // London
);
const surfaceDist = geodesic.surfaceDistance; // ~5,837,000 m (~5,837 km)
const midCarto = geodesic.interpolateUsingFraction(0.5); // midpoint on surface
// Chord (straight-line through ellipsoid interior) -- rarely what you want for geography
const chord = Cartesian3.distance(
Cartesian3.fromDegrees(-73.985, 40.758),
Cartesian3.fromDegrees(-0.1276, 51.5074),
); // shorter than surfaceDistance; do NOT use for "distance between cities"When labeling distances, format from surfaceDistance (meters) divided by 1000 and rounded to the nearest km. For very short distances (< ~1 km) the chord and surface distance agree to within rounding; for anything continental, prefer EllipsoidGeodesic.
interpolateUsingFraction returns a Cartographic. Convert each sample to Cartesian3 before passing to polylines or other geometry APIs. Use enough samples (>= ~64 for transoceanic arcs) so the polyline visibly curves rather than appearing as a straight rhumb-like line.
import { Cartographic, EllipsoidGeodesic, Cartesian3 } from "cesium";
const start = Cartographic.fromDegrees(-73.985, 40.758); // NYC
const end = Cartographic.fromDegrees(-0.1276, 51.507); // London
const geodesic = new EllipsoidGeodesic(start, end);
const N = 64;
const positions = [];
for (let i = 0; i <= N; i++) {
const carto = geodesic.interpolateUsingFraction(i / N);
// Convert Cartographic (radians) to Cartesian3
positions.push(Cartesian3.fromRadians(carto.longitude, carto.latitude, carto.height));
}
// positions is now a Cartesian3[] suitable for polyline entity positions
// Label the midpoint with the great-circle distance, not the chord
const midCarto = geodesic.interpolateUsingFraction(0.5);
const midPos = Cartesian3.fromRadians(midCarto.longitude, midCarto.latitude, midCarto.height);
const km = (geodesic.surfaceDistance / 1000).toFixed(0);
viewer.entities.add({
position: midPos,
label: { text: `Distance: ${km} km` },
});import { BoundingSphere, Cartesian3 } from "cesium";
const sphere = BoundingSphere.fromPoints(
Cartesian3.fromDegreesArray([-105, 40, -100, 40, -100, 35]),
); // sphere.center (Cartesian3), sphere.radius (number)
const inside = Cartesian3.distance(sphere.center, Cartesian3.fromDegrees(-102, 37.5)) <= sphere.radius;sphere.center is a Cartesian3 (ECEF) and can be used directly as an entity position. sphere.radius is in meters and can be passed as ellipsoid radii for visualization. Use a low alpha (≈0.3) so the enclosed points and underlying geography remain visible through the sphere -- an overly opaque sphere hides exactly the data it is meant to bound:
import { Color, Cartesian3 } from "cesium";
viewer.entities.add({
position: sphere.center,
ellipsoid: {
radii: new Cartesian3(sphere.radius, sphere.radius, sphere.radius),
material: Color.YELLOW.withAlpha(0.3), // translucent so input points stay visible
outline: true,
outlineColor: Color.YELLOW,
},
});import { Ray, IntersectionTests, Plane, Cartesian3, Ellipsoid } from "cesium";
const ray = new Ray(new Cartesian3(0, 0, 6378137), new Cartesian3(0, 0, -1)); // auto-normalized
const ptOnRay = Ray.getPoint(ray, 1000.0, new Cartesian3());
// Ray-plane: returns Cartesian3 or undefined
const plane = Plane.fromPointNormal(Cartesian3.ZERO, Cartesian3.UNIT_Z);
const hit = IntersectionTests.rayPlane(ray, plane);
// Ray-ellipsoid: returns Interval {start, stop} or undefined
const camRay = new Ray(new Cartesian3(0, 0, 20000000), new Cartesian3(0, 0, -1));
const interval = IntersectionTests.rayEllipsoid(camRay, Ellipsoid.WGS84);
if (interval) {
const nearPt = Ray.getPoint(camRay, interval.start, new Cartesian3());
}
// Ray-triangle: returns parametric t or undefined
const t = IntersectionTests.rayTriangleParametric(ray, p0, p1, p2, true);import { SceneTransforms, Cartesian3 } from "cesium";
// World -> pixel coordinates (Cartesian2 or undefined if off-screen)
const winPos = SceneTransforms.worldToWindowCoordinates(viewer.scene, Cartesian3.fromDegrees(-105, 40));
// High-DPI aware variant
const bufPos = SceneTransforms.worldToDrawingBufferCoordinates(viewer.scene, worldPos);import { GeographicProjection, WebMercatorProjection, Cartographic, Ellipsoid } from "cesium";
const carto = Cartographic.fromDegrees(-105.0, 40.0);
// Plate Carree: project/unproject between Cartographic and Cartesian3
const geoProj = new GeographicProjection(Ellipsoid.WGS84);
const xy = geoProj.project(carto); // Cartesian3
const back = geoProj.unproject(xy); // Cartographic
// Web Mercator (EPSG:3857)
const merc = new WebMercatorProjection(Ellipsoid.WGS84);
const mercXY = merc.project(carto);import { Cartesian3, Transforms, Matrix4 } from "cesium";
const origin = Cartesian3.fromDegrees(-105.0, 40.0, 0.0);
const enu = Transforms.eastNorthUpToFixedFrame(origin);
// Move 500m east, 200m north, 100m up in local frame
const worldPt = Matrix4.multiplyByPoint(enu, new Cartesian3(500, 200, 100), new Cartesian3());import { Cartesian3, Math as CesiumMath } from "cesium";
const a = Cartesian3.fromDegrees(-105.0, 40.0);
const b = Cartesian3.fromDegrees(-105.0001, 40.0001);
Cartesian3.equalsEpsilon(a, b, CesiumMath.EPSILON7); // preferred over ===
if (Cartesian3.distance(a, b) < 10.0) { /* within 10m */ }result objects outside loops to avoid GC pauses.distanceSquared instead of distance when comparing -- avoids Math.sqrt.Cartesian3.fromDegrees over manual Cartographic creation then conversion.Transforms.eastNorthUpToFixedFrame once if position is static.Matrix4.inverseTransformation for rigid-body transforms -- faster and more stable than inverse.fromDegreesArray / fromDegreesArrayHeights instead of looping fromDegrees.Cartesian3.normalize -- it throws on zero-length vectors. Check magnitude first.equalsEpsilon for float comparisons. CesiumMath.EPSILON7 is a good default tolerance.Cartesian3.distance = chord through Earth (rarely what you want for geography). EllipsoidGeodesic.surfaceDistance = great-circle surface distance (use this for city-to-city labels).© CesiumGS, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/cesiumjs-spatial-math of CesiumGS/cesiumjs-skills.
Open the folder on GitHubat commit 5f4792c
Cesiumjs Spatial Math next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Cesiumjs Spatial Math this skillCesiumGS/cesiumjs-skills | 189 | — | ~4.6k | Automated safety check: Pass | Apache-2.0 | |
| TransformersK-Dense-AI/scientific-agent-skills | 48k | 1 repos | ~2.8k | Automated safety check: Notes | Apache-2.0 | |
| Mathparcadei/Continuous-Claude-v3 | 3.9k | 3 repos | ~1.6k | Automated safety check: Notes | MIT | |
| Math Computationtradecatlabs/vibe-coding-cn | 17k | — | ~881 | Automated safety check: Pass | MIT | |
| Rigorous Math Prooftradecatlabs/vibe-coding-cn | 17k | — | ~571 | Automated safety check: Pass | MIT | |
| Hugging Face Transformers Usagedavila7/claude-code-templates | 32k | 12 repos | ~1.2k | Automated safety check: Pass | MIT |
K-Dense-AI/scientific-agent-skills
Hugging Face Transformers for loading Hub models, running pipeline inference, text generation, and Trainer fine-tuning on NLP, vision, audio, and multimodal tasks.
parcadei/Continuous-Claude-v3
Unified math capabilities - computation, solving, and explanation.
tradecatlabs/vibe-coding-cn
Runs reproducible math computations and counterexample searches with SymPy, NumPy and mpmath, logging evidence without presenting results as proofs.
tradecatlabs/vibe-coding-cn
Writes and audits natural-language math proofs as checkable packages, with explicit assumptions, proof obligations and counterexample hunting, refuting or repairing weak claims.
davila7/claude-code-templates
Loads pre-trained Hugging Face Transformers models for text, vision and audio tasks, runs inference with pipelines and fine-tunes on custom datasets.
FreedomIntelligence/OpenClaw-Medical-Skills
Analyze high-resolution spatial platforms like Slide-seq, Stereo-seq, and Visium HD.
CesiumGS/cesiumjs-skills
CesiumJS 3D Tiles - Cesium3DTileset, compressed and CAD-style glTF content, MVTDataProvider, UrlTemplate3DTilesDataProvider, styling, metadata, feature picking, voxels, point clouds, I3S, Gaussian…
CesiumGS/cesiumjs-skills
CesiumJS core utilities and networking - Resource, Color, Event, Request, RequestScheduler, error handling, helper functions, feature detection.
CesiumGS/cesiumjs-skills
CesiumJS materials and post-processing — Material, Fabric JSON, MaterialAppearance, ImageBasedLighting, PostProcessStage, PostProcessStageLibrary, bloom, depth of field, ambient occlusion, FXAA…
CesiumGS/cesiumjs-skills
CesiumJS terrain, globe, and environment - TerrainProvider, Globe, sampleTerrain, atmosphere, sky, fog, lighting, shadows, panoramas.
CesiumGS/cesiumjs-skills
CesiumJS viewer setup - Viewer, CesiumWidget, widgets, Ion token, Scene configuration, SceneMode, factory helpers, geocoders, platform services.
CesiumGS/cesiumjs-skills
CesiumJS camera control - Camera, flyTo, lookAt, setView, ScreenSpaceCameraController, composable Controller camera controllers (1.144), CameraEventAggregator, flight animation.
CesiumJS spatial math - Cartesian3, Cartographic, Matrix4, Quaternion, Transforms, Ellipsoid, BoundingSphere, projections, coordinate conversions. Cesiumjs Spatial Math is an agent skill from CesiumGS/cesiumjs-skills. CesiumJS spatial math - Cartesian3, Cartographic, Matrix4, Quaternion, Transforms, Ellipsoid, BoundingSphere, projections, coordinate conversions.
Cesiumjs Spatial Math fits situations like: converting between coordinate systems; computing positions on the ellipsoid; performing spatial intersection tests; building model matrices.
Run `npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-spatial-math -a claude-code`. Or copy the skill folder (skills/cesiumjs-spatial-math in CesiumGS/cesiumjs-skills) into .claude/skills/cesiumjs-spatial-math in your project. Claude Code loads it when a task matches its description.
Run `npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-spatial-math -a codex`. Or copy the skill folder (skills/cesiumjs-spatial-math in CesiumGS/cesiumjs-skills) into .agents/skills/cesiumjs-spatial-math in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-spatial-math -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cesiumjs-spatial-math, .gemini/skills/cesiumjs-spatial-math, .github/skills/cesiumjs-spatial-math and .opencode/skills/cesiumjs-spatial-math in your project.
SKILL.md names no scripts, command-line tools or credentials: Cesiumjs Spatial Math is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Cesiumjs Spatial Math is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 4.6k tokens (SKILL.md is roughly 18k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Cesiumjs Spatial Math: Transformers (K-Dense-AI/scientific-agent-skills, 48k stars), Math (parcadei/Continuous-Claude-v3, 3.9k stars), Math Computation (tradecatlabs/vibe-coding-cn, 17k stars) and Rigorous Math Proof (tradecatlabs/vibe-coding-cn, 17k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
CesiumGS (a GitHub organization) maintains it in CesiumGS/cesiumjs-skills, which has 189 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on September 14, 2026.
Source: CesiumGS/cesiumjs-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.