polish #8

Merged
a.petrov merged 4 commits from polish into main 2026-06-08 09:16:14 +00:00
Owner
No description provided.
a.antonov added 1 commit 2026-05-17 18:18:31 +00:00
a.antonov added 1 commit 2026-05-22 15:55:39 +00:00
a.petrov approved these changes 2026-05-29 05:03:14 +00:00
@ -0,0 +117,4 @@
// verts[0] before testing, so a polygon spanning the antimeridian is
// handled correctly as long as the polygon itself spans no more than 180°
// in longitude.
func pointInPolygon(lat, lng float64, verts []PolygonVertex) bool {
First-time contributor

Computationally expensive, should be moved into numerics

Computationally expensive, should be moved into numerics
@ -0,0 +11,4 @@
//
// Useful for combining a vertical-rate model with a horizontal wind model
// into a single propagator. Equivalent to Tawhiri's LinearModel.
func Sum(models ...Model) Model {
First-time contributor

Move all computations into numerics

Move all computations into numerics
@ -0,0 +42,4 @@
// v = -k / sqrt(rho(alt)), k = seaLevelRate * 1.1045,
//
// using the NASA atmosphere model for rho. Equivalent to Tawhiri's drag_descent.
func ParachuteDescent(seaLevelRate float64) Model {
First-time contributor

Move into numerics

Move into numerics
@ -0,0 +52,4 @@
// nasaDensity returns air density (kg/m^3) for an altitude in metres,
// using the NASA simple atmosphere model.
// See https://www.grc.nasa.gov/WWW/K-12/airplane/atmosmet.html.
func nasaDensity(alt float64) float64 {
First-time contributor

Move into numerics

Move into numerics
@ -0,0 +102,4 @@
//
// If events is non-nil, an "above_model" event is emitted whenever the
// wind field reports altitude above the highest pressure level.
func WindTransport(field weather.WindField, events *EventSink) Model {
First-time contributor

Move into numerics

Move into numerics
@ -0,0 +262,4 @@
out := make([]RateSegment, 0, len(in))
for _, s := range in {
var until float64
switch s.Reference {
First-time contributor

Clean up?

Clean up?
@ -0,0 +4,4 @@
// pymod returns a % b with Python semantics: the result has the sign of b,
// so for b > 0 the result is always in [0, b).
func pymod(a, b float64) float64 {
First-time contributor

Move to numerics; is this still necessary?

Move to numerics; is this still necessary?
@ -0,0 +17,4 @@
//
// Time is not stored in State — it is tracked separately by the integrator
// and passed to Model.
func stateAdd(y State, k float64, dy State) State {
First-time contributor

Move to numerics

Move to numerics
@ -0,0 +27,4 @@
// stateLerp computes the linear interpolation of two states by parameter l
// in [0, 1]. Longitude uses lngLerp so that wrap-around is handled.
func stateLerp(a, b State, l float64) State {
First-time contributor

Should be moved to numerics

Should be moved to numerics
@ -0,0 +37,4 @@
// lngLerp interpolates between two longitudes in [0, 360), choosing the
// shorter great-circle arc.
func lngLerp(a, b, l float64) float64 {
First-time contributor

Should be moved to numerics library

Should be moved to numerics library
a.antonov added 1 commit 2026-05-29 21:29:46 +00:00
a.antonov added 1 commit 2026-05-29 21:38:42 +00:00
First-time contributor

изображение

lgtm👍

![изображение](/attachments/8f8c60b9-700d-475a-802e-c684d93defb1) lgtm👍
a.petrov merged commit 1bd9143186 into main 2026-06-08 09:16:14 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: gsn/predictor#8
No description provided.