npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

newton-arc

v0.2.1

Published

Terminal projectile motion demo — Newton's apple launch (CLI animation + predictions)

Readme

🍎 Newtonify Trajectory (newton-arc)

Visualize Newton’s Apple in motion — right in your terminal!
A CLI-based physics demo that animates projectile motion (the classic Newton apple 🍏) in a glowing yellow arc.


🌠 Overview

Newtonify Trajectory brings physics to your terminal by simulating projectile motion — inspired by Isaac Newton’s legendary apple.
Watch as the apple travels along a smooth curved trajectory traced with a glowing yellow line, showcasing real physics in action.

“If I have seen further, it is by standing on the shoulders of giants.” — Sir Isaac Newton


🧠 How It Works

The motion follows the fundamental kinematics equations for a projectile:

[ x = v \cos(\theta) t ] [ y = v \sin(\theta) t - \frac{1}{2} g t^2 ]

Where:

  • ( v ) = initial speed
  • ( \theta ) = launch angle
  • ( g ) = acceleration due to gravity
  • ( t ) = time elapsed

At each frame, the program:

  1. Calculates the next (x, y) coordinates.
  2. Renders the apple 🍎 at that position.
  3. Draws a yellow curved trail behind it.
  4. Updates the terminal in real time to create the illusion of motion.

🖼️ Example Output

Here’s what you’ll see in your terminal 👇

    🍎
   ╱
  ╱
 ╱
╱

*(A curved yellow line with a moving apple above it — rendered frame by frame!)*

---

## 🚀 Installation

### 1️⃣ Install globally (recommended)
```bash
npm install -g newton-arc

2️⃣ Run instantly without installing

npx newton-arc

3️⃣ Clone & run locally

git clone https://github.com/Layyzyy/Newtonify_Trajectory.git
cd Newtonify_Trajectory
npm install
node index.js

⚙️ Command Options

Customize your launch parameters directly from the CLI:

npx newton-arc --speed 25 --angle 60 --gravity 9.8 --step 0.1

| Option | Description | Default | Example | |---------|--------------|----------|----------| | --speed | Initial launch speed (m/s) | 10 | --speed 20 | | --angle | Launch angle in degrees | 45 | --angle 60 | | --gravity | Gravity (m/s²) | 9.8 | --gravity 9.81 | | --step | Time step interval | 0.1 | --step 0.05 |


🎨 Features

✅ Animated projectile motion in real time
✅ Glowing yellow trajectory curve
✅ Physics-accurate motion path
✅ Adjustable parameters via CLI
✅ Smooth animation loop using Node.js
✅ Hidden terminal cursor for a clean view


🧩 Dependencies

Make sure you have Node.js ≥ 14 installed.

This project uses:

  • 🟢 chalk → Colorful terminal output
  • 🔵 cli-cursor → Hides cursor during animation
  • 🟣 commander → Handles CLI argument parsing

Install locally:

npm install

🧪 Development Setup

  1. Clone this repository
  2. Open index.js and tweak parameters for experiments
  3. Run:
    node index.js
  4. (Optional) Publish your own version:
    npm login
    npm version patch
    npm publish

🧠 Educational Use

This project can be used for:

  • 🚸 Demonstrating projectile motion in classrooms
  • 🧑‍💻 Teaching physics via code
  • 💬 Creating interactive CLI physics demos
  • 🎓 Understanding kinematic equations practically

📸 Screenshots

Here’s a quick look at how the Newtonify Trajectory simulation works 🚀 Newtonify Trajectory Demo (The apple follows a realistic projectile motion curve, showing gravity’s effect in real time!)


🧑‍💻 Author

👩‍🚀 Layyshahh
✨ GitHub: @Layyzyy
🚀 Project: Newtonify Trajectory


🪄 License

This project is licensed under the MIT License
© 2025 — Created with ❤️ and physics by Lay Shah


🌌 Quote Before Launch

“Gravity explains the motions of the planets, but it cannot explain who sets the planets in motion.”
Isaac Newton


💫 Try It Now!

Run instantly in your terminal:

npx newton-arc --angle 60 --speed 25

Let the apple fly 🍎✨
And watch Newton’s discovery come alive — in your command line!