You are browsing as a guest. Sign up (or log in) to start making projects!

CSmith

@CSmith

Joined October 10th, 2026

  • 1Devlogs
  • 2Projects
  • 0Ships
  • 0Votes
Open comments for this post

2h 32m 32s logged

Created a proof of concept This is very ugly, and just to prove that my algorithm will work in Javascript. This will also provide a “backbone” that will be torn down and rebuilt. It i just some prompt boxes and two ugly lines of formulas, but here is the code: function degrees(radians) {        return radians * (180 / Math.PI);    }    var v = Number(prompt("Enter initial velocity (m/s):"));    var d = Number(prompt("Enter distance (m):"));    var h = Number(prompt("Enter height (m):"));    var g = Number(prompt("Enter absolute acceleration due to gravity (m/s^2):"));    var thetaHR = Math.atan((d*v**2+v**2*Math.sqrt(d**2-4*((g*d**2)/(2*v**2))*((g*d**2)/(2*v**2)+h)))/(g*d**2));    var thetaLR = Math.atan((d*v**2-v**2*Math.sqrt(d**2-4*((g*d**2)/(2*v**2))*((g*d**2)/(2*v**2)+h)))/(g*d**2));    var thetaH = degrees(thetaHR);    var thetaL = degrees(thetaLR);    alert("High angle: " + thetaH + " degrees\nLow angle: " + thetaL + " degrees");

0
0
12

Followers

Loading…