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

rophysics

v1.0.2

Published

Roblox Projectile Physics Functions

Readme

RoPhysics

Projectile Physics Calculations For Roblox Projectiles

About

RoPhysics is a JS library that calculates Roblox projectile physics.

Installation / Requirements

  • npm install rophysics --save
  • requirements: Node.js & npm (latest versions).

Usage

The functions file contains more detailed documentation, located in src folder

Calculate Projectile Trajectory Via Velocity:

const { trajectory } = require('rophysics');

/**
 * velocity =  initial muzzle velocity at which projectile was launched.
 * degree   =  angle at which projetile was launched (defaults to 45 degrees if left empty).
 * 
 * trajectory(velocity, degree)
 * 
 */
const data = trajectory(300)

console.log(data)

/* logs:
{
 muzzleVelocity: 300,
 launchAngle: {
  rad: 0.7853981633974483,
  deg: 45
 },
 distance: 458.72,
 height: 114.68,
 time: 2.16
}

 */

Advanced Usage:

This module provides more functions:

/*
  Convert meters to studs.
  meter = Number of meters to convert
  metersToStuds(meter)
 */
const { metersToStuds } = require('rophysics')

const meters = metersToStuds(20)
// => 196.2 studs


/*
  Convert studs to meters.
  studs = Number of studs to covert
  studsToMeters(studs)
 */
const { studsToMeters } = require('rophysics')

const studs = studsToMeters(196.2)
// => 20 meters


/*
  Calculate maximum projectile distance only
  velocity = projectile velocity (muzzle)
  degree = angle at which projectile was launched (default to 45 degrees if left empty)
  maxDistance(velocity, degree)
 */
const { maxDistance } = require('rophysics')

const distance = maxDistance(300, 45)
// => 458.72 (studs)


/*
  Calculate maximum projectile height only
  velocity = projectile velocity (muzzle)
  degree = angle at which projectile was launched (default to 45 degrees if left empty)
  maxHeight(300, 45)

 */
const { maxHeight } = require('rophysics')

const height = maxDistance(300, 45)
// => 114.68 (studs)


/*
  Calculate projectile travel time (when it hits the "earth") only
  velocity = projectile velocity (muzzle)
  degree = angle at which projectile was launched (default to 45 if left empty)
  timeTraveled(velocity, degree) 
 */
const { timeTraveled } = require('rophysics')

const time = timeTraveled(300, 45)


/*
  Convert degrees to radians
 */
const { degToRad } = require('rophysics')

const radian = degToRad(45)
// => 0.7853981633974483


/*
  Convert radians to degrees
 */
const { radToDeg } = require('rophysics')

const degree = radToDeg(0.7853981633974483)
// => 45

Understanding Projectile Physics

  • Roblox Blog(s):
  1. Potato Cannons
  2. Forum
  • YouTube videos/playlist on projectiles physics:
  1. Motion: 2D Kinematics
  2. Projectile Motion Equation
  3. Projectile Motion Example
  4. Fire A Bullet
  5. Bullet Drop

Contributing

Please make a PR or contact me via discord @midknightmare#666 or twitter @midknightmare

License

MIT