Linear Algebra·normalizing-vectors
Normalizing Vectors
Calculate the unit vector in the same direction as a given vector by dividing the vector by its magnitude.
Math animationLinear Algebra · normalizing-vectors
✓ All 2 test cases pass.
Inputs
Test cases
These cases run live in your browser every time the page loads. If any fail, the calculator is broken — file an issue.
| # | Inputs | Expected | Got | Status |
|---|---|---|---|---|
| 1 | {"vector":[3,-1,-1]} | 0.9045340337332909,-0.30151134457776363,-0.30151134457776363 | 0.9045340337332909,-0.30151134457776363,-0.30151134457776363 | ✓ |
| 2 | {"vector":[1,2,2]} | 0.3333333333333333,0.6666666666666666,0.6666666666666666 | 0.3333333333333333,0.6666666666666666,0.6666666666666666 | ✓ |
APIDeveloper APICall this calculator from codeexpand ↓
Endpoint
POST
/api/calculators/linear-algebra/normalizing-vectors/computeInputs (1)
vectorvectordefault[1,1,1]
Example
curl -sX POST http://localhost:3001/api/calculators/linear-algebra/normalizing-vectors/compute \
-H "Content-Type: application/json" \
-d '{"inputs":{"vector":[1,1,1]}}'Try it live
Edit the body below, then click Call API.Request body
Response
(click Call API to see the response)Source: Pattern from: combinepdf.pdf. Reproduces a standard normalizing-vectors computation; problem text paraphrased.
AI disclosure: Calculator code generated by openai/gpt-4o-mini-2024-07-18; verified by 2 test cases.