Codync
免费开源的 1:1 Grok Bot 与 Muse 替代方案。可在 iPhone、Mac 或 Linux 桌面上将 Claude 代码、Codex、Cursor 以及 40 多个编码代理作为持久机器人使用。支持群组聊天、线程、应用。
AI 翻译
尚未收集仓库信息。
尚未检测到更新。GitHub 发布版本后会显示在这里。
Route geometry and pace physics for cycling, hiking and running in Swift: power-based bike speed, DIN/SAC hiking times, Minetti running pace, noise-filtered ascent and live-ride filters. Held to the JavaScript port's numbers.
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗Route geometry and pace physics for cycling, hiking and running, in Swift. It powers the route planning, arrival times and live ride tracking in Hatchure on iPhone and Apple Watch.
Try the models in the browser → (the JavaScript port, which gives the same numbers).
Pure value types and static functions: no UI, no networking, no global state. It needs only Foundation and CoreLocation.
Speed for two riders on the same road, gradient by gradient. Below −2% the model has the rider stop pedalling and freewheel, which is the step in both curves, and descents are capped at 65 km/h.
Minutes per kilometre on foot: hiking by the DIN 33466 signpost rule, trail running by Minetti's cost of running on a slope, never faster downhill than 85% of the flat pace.
| Product | What it holds |
|---|---|
TrailPhysicsGeo | RouteGeometry, BoundingBox, RouteLineDecimation, Sun |
TrailPhysics | RiderPhysics, FootPace, RouteElevation, RouteProfile, RideSpeedWindow, RideOffRoute, RideAscent, RideOdometer, RideProfileMath, RideBearing, and turn-by-turn cues: RouteCue, CuePlan (which turns to say, merged, with the way ahead and heads-ups), CueTracker (when to say each). Re-exports TrailPhysicsGeo. |
Platforms: iOS 18, watchOS 11, macOS 14.
.package(url: "https://github.com/ehilzinger/trailphysics-swift", from: "0.1.0")
then .product(name: "TrailPhysics", package: "trailphysics-swift") (or
TrailPhysicsGeo alone) in your target's dependencies.
import CoreLocation
import TrailPhysics
let line: [CLLocationCoordinate2D] = [
.init(latitude: 46.00, longitude: 7.00),
.init(latitude: 46.01, longitude: 7.01),
.init(latitude: 46.02, longitude: 7.02),
]
let elevations: [Double] = [1_200, 1_350, 1_500]
// How fast a 75 kg rider on an 18 kg bike at 180 W covers it.
let rider = RiderPhysics.Rider(riderKg: 75, bikeKg: 18, watts: 180)
let kmh = RiderPhysics.detailedSpeedKmh(rider: rider, latlngs: line, elevations: elevations)
// How long it takes to hike.
let seconds = FootPace.routeSeconds(latlngs: line, elevations: elevations, profile: .hiking)
// Metres climbed, filtered for noise.
let climbed = RouteElevation.ascent(elevations)
// Where a GPS fix sits along the line.
let cumulative = RouteGeometry.cumulativeDistances(line)
let fix = CLLocationCoordinate2D(latitude: 46.012, longitude: 7.011)
let position = RouteGeometry.project(fix, along: line, cumulative: cumulative)
// When the sun sets at the start today.
let sunset = Sun.sunset(on: .now, lat: line[0].latitude, lng: line[0].longitude)
RouteProfile names seven ways a route can be drawn (bike, gravel,
road, roadfast, hiking, trailrun, roadrun) in three sports. The pace
and ride models switch on it. Its raw values are a stored format, so they
never change. Display names and routing-engine ids are left to the host app.
swift test
There is a JavaScript port of the same models,
trailphysics on npm. The
test vectors in Tests/TrailPhysicsTests/Fixtures/ (foot pace, rider
physics, elevation, cues) are byte-identical copies of the files that port
writes, and both test suites read every vector, so the two agree to within
a millionth on every figure they share, and exactly on every cue.
Copyright 2026 Enzo Hilzinger.
Licensed under the Apache License, Version 2.0. See LICENSE.