NKTgLaw

NKTgLaw

Experimental Verification of the NKT Law with NASA Planetary Data (Go Implementation)

Hi everyone :waving_hand:

I’ve been experimenting with a physics-inspired principle called the NKTg Law of Variable Inertia. The core idea is that an object’s motion depends on the interaction between its position, velocity, and mass.

The formula is simple:

m = NKTg1 / (x * v)

where:

  • x = position (km)

  • v = velocity (km/s)

  • NKTg1 = x * (m * v)

I used NASA’s real-time data (30–31 Dec 2024) for the 8 planets and tested whether this law can interpolate planetary masses. To my surprise, the interpolated values matched NASA’s published masses with almost zero error. :rocket:

Here’s a minimal Go implementation:

package main

import (
    "fmt"
)

type Planet struct {
    Name   string
    X      float64
    V      float64
    NKTg1  float64
    NASAm  float64
}

func main() {
    planets := []Planet{
        {"Mercury", 6.9817930e7, 38.86, 8.951e32, 3.301e23},
        {"Venus",   1.0893900e8, 35.02, 1.858e34, 4.867e24},
        {"Earth",   1.4710000e8, 29.29, 2.571e34, 5.972e24},
        {"Mars",    2.4923000e8, 24.07, 3.850e33, 6.417e23},
        {"Jupiter", 8.1662000e8, 13.06, 2.024e37, 1.898e27},
        {"Saturn",  1.5065300e9, 9.69,  8.303e36, 5.683e26},
        {"Uranus",  3.0013900e9, 6.8,   1.772e36, 8.681e25},
        {"Neptune", 4.5589000e9, 5.43,  2.534e36, 1.024e26},
    }

    fmt.Printf("%-10s %-15s %-15s %-10s\n", "Planet", "NASA_m", "Interpolated_m", "Error(%)")

    maxError := 0.0

    for _, p := range planets {
        interp := p.NKTg1 / (p.X * p.V)
        delta := (p.NASAm - interp) / p.NASAm * 100
        if delta < 0 {
            if -delta > maxError {
                maxError = -delta
            }
        } else if delta > maxError {
            maxError = delta
        }

        fmt.Printf("%-10s %-15.5e %-15.5e %-10.5e\n", p.Name, p.NASAm, interp, delta)
    }

    fmt.Printf("\nMax relative error: %.5e %%\n", maxError)
}


:white_check_mark: Expected output: A table showing NASA’s official masses vs interpolated masses.
Relative errors are essentially 0%, confirming the interpolation works exactly.


:light_bulb: Open question for Devtalk:

  • How would you improve this Go code to be more idiomatic or efficient?

  • Would you try rewriting this experiment in another language (Rust, Elixir, Scala, Ruby) and compare results?

I think it’s a fun way to combine physics-inspired laws with coding practice. Curious to hear your thoughts!

/go

Where Next?

Popular General Dev topics Top

AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
Exadra37
Cloudflare as workers to run serverless code without using containers: So it seems that Isolates is based on: What we ended up settl...
New
AstonJ
Inspired by this tweet by @dasdom Even if you take out all the damage being done by humans, our planet has about 50B years before bein...
New
New
jamiedumont
This is all going to be a bit hand-wavey and straight off the top of my head, so bear with me, but it’s a thought/debate that’s been ratt...
New
TwistingTwists
Hello Fellow developers, I have been trying to wrap my head around How difficult would it have been to be a dev 20-30 years ago? I have...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
AstonJ
00:00 The Year 2022 00:38 Web3 03:28 Metaverse 05:05 AI 06:22 Databases 07:31 JavaScript 09:58 Other Trends to Know WDYT - what wi...
New
Exadra37
Your users of the two forums are spread across the world, thus I am curious how did you solved it?
New

Other popular topics Top

axelson
I’ve been really enjoying obsidian.md: It is very snappy (even though it is based on Electron). I love that it is all local by defaul...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
PragmaticBookshelf
Develop, deploy, and debug BEAM applications using BEAMOps: a new paradigm that focuses on scalability, fault tolerance, and owning each ...
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New
AstonJ
This is cool! DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON We just witnessed something incredible: the largest open-s...
New
NewsBot
Node.js v22.14.0 has been released. Link: Release 2025-02-11, Version 22.14.0 'Jod' (LTS), @aduh95 · nodejs/node · GitHub
New