SHM velocity calculator
The SHM velocity calculator finds the magnitude of an oscillator's instantaneous velocity at a chosen displacement.
Run — free
Enter the amplitude, the signed displacement from equilibrium, and the angular frequency. The calculator applies v = omega times the square root of amplitude squared minus displacement squared. It also checks the physical domain before calculating, so a displacement beyond either turning point produces a clear error instead of an imaginary or misleading result during routine physics work.
Understand what the result represents
In ideal simple harmonic motion, an object repeatedly travels between two turning points located one amplitude on either side of equilibrium. Its speed is not constant. It is greatest as the object passes through equilibrium and falls to zero at either turning point. This calculator returns the nonnegative magnitude of that instantaneous velocity using v = omega sqrt(A squared minus x squared), where A is amplitude, x is displacement, and omega is angular frequency. Because the formula gives a magnitude, it does not identify whether the oscillator is moving toward positive or negative displacement at that instant. The same position is normally crossed twice in a cycle, once in each direction. To assign a signed velocity, you would also need phase information or a stated direction of travel. Keep amplitude and displacement in the same length unit. If they are in metres and omega is in radians per second, the returned velocity is in metres per second; centimetres and radians per second produce centimetres per second. Radians are dimensionless in this calculation.
Enter values that describe one consistent oscillator
Amplitude is the greatest distance from equilibrium, so enter it as a nonnegative value. Displacement is signed: positions on opposite sides of equilibrium may be represented by positive and negative values, but the velocity magnitude is the same for x and minus x. Angular frequency omega must also be nonnegative and is commonly obtained from omega = 2 pi f when ordinary frequency f is known, or omega = 2 pi divided by T when the period T is known. All three inputs must be finite numbers. Most importantly, the absolute displacement cannot be larger than the amplitude. Such a position lies outside the oscillator's allowed path and would make A squared minus x squared negative. The calculator rejects that case explicitly. A displacement exactly equal to either positive or negative amplitude is valid and returns zero, matching the momentary stop at a turning point. A zero amplitude is also accepted only with zero displacement, describing an oscillator with no motion and therefore zero velocity.
Interpret checks and numerical edge cases
Use the result as an ideal-model value. The equation assumes undamped simple harmonic motion with a constant angular frequency and a restoring force proportional to displacement. Real springs may have friction, changing amplitude, nonlinear stiffness, or measurement uncertainty; pendulums follow the simple model closely only at small angles. The domain check is therefore mathematical and physical, but it cannot decide whether the ideal model suits a particular apparatus. Near a turning point, the quantity under the square root becomes very small, so uncertainty in amplitude or displacement can cause a relatively large percentage uncertainty in velocity. Retain reasonable measurement precision instead of treating every displayed digit as experimentally significant. The implementation evaluates the difference of squares in factored form, using (A minus absolute x) times (A plus absolute x), which reduces avoidable overflow for some large, nearby values while remaining algebraically equivalent. If the final result exceeds the finite numeric range, the request is rejected rather than returning Infinity. For signed velocity or time-dependent position, supplement this calculation with phase and direction data.
What you can do with it
Check a spring-mass experiment
Compare the predicted speed at a measured displacement with a laboratory velocity measurement.
Solve a physics exercise
Compute the instantaneous speed after amplitude, position, and angular frequency have been established.
Validate simulation output
Cross-check an undamped oscillator simulation against the analytical position-speed relationship.
FAQ
What does the calculator cost?
It is free to run in your browser, or $0.002 per API request.
Why is the returned velocity always nonnegative?
The displacement-only formula determines velocity magnitude. A signed velocity also requires the direction of travel or phase.
What happens when displacement equals amplitude?
The result is zero because the oscillator momentarily stops at either turning point.
Why is displacement beyond amplitude rejected?
That position is outside the oscillator's path and would make the square-root expression negative.
Which units should I use?
Use one length unit for both amplitude and displacement. With omega per second, the output uses that length unit per second.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/mech/shm-velocity \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"amplitude":5,"displacement":3,"omega":2}'const res = await fetch("https://api.kit.forhosting.com/mech/shm-velocity", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"amplitude": 5,
"displacement": 3,
"omega": 2
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/mech/shm-velocity",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"amplitude": 5,
"displacement": 3,
"omega": 2
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/mech/shm-velocity", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"amplitude":5,"displacement":3,"omega":2}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"amplitude":5,"displacement":3,"omega":2}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/mech/shm-velocity", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"amplitude": 5,
"displacement": 3,
"omega": 2
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "mech.shm_velocity",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |