Normal line to surface calculator
On the sphere x² + y² + z² at the point (1, 2, 2), the gradient is (2, 4, 4), so the normal line is r(t) = (1, 2, 2) + t·(2, 4, 4) and the unit normal is (1, 2, 2) divided by 3. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- X0
- 1
- Y0
- 2
- Z0
- 2
- Fx
- 2
- Fy
- 4
- Fz
- 4
- Gradient
- 2, 4, 4
- Direction
- 2, 4, 4
- Gradient magnitude
- 6
- Unit normal
- 0.3333333333, 0.6666666667, 0.6666666667
In multivariable calculus the gradient of a level function F is orthogonal to every tangent direction in the surface F(x,y,z) equals c. Once you evaluate the partial derivatives at a point of contact, that single vector is the direction of the unique normal line through the point. Students, tutors, and automation scripts need those parametric equations without re-deriving the algebra for every homework surface. This normal line to surface calculator accepts the three coordinates of the point and the three gradient components, rejects a zero gradient as a singular case, and returns parametric component equations, a vector form r(t), a symmetric form, the gradient magnitude, and a unit normal.
What the normal line is and why the gradient is its direction
A level surface in three-dimensional space is the set of points where a smooth scalar field F takes a constant value c. At a regular point P0 on that surface the gradient vector formed by the three first partial derivatives of F is perpendicular to the tangent plane: every curve that stays on the surface and passes through P0 has a velocity vector orthogonal to the gradient. The line that passes through P0 and is parallel to the gradient is therefore the normal line to the surface at that point.
In parametric form the line is written r of t equals P0 plus t times the gradient at P0, which expands componentwise into x equals x0 plus F_x times t, y equals y0 plus F_y times t, and z equals z0 plus F_z times t. When none of the partials is zero the same geometry admits a symmetric form that sets the three fractions (x minus x0) over F_x, (y minus y0) over F_y, and (z minus z0) over F_z equal to one another.
If one partial vanishes, the corresponding coordinate is fixed at the point of contact and the symmetric display keeps that constraint explicit. You evaluate F_x, F_y, and F_z yourself for whatever algebraic F your problem uses—sphere, ellipsoid, hyperboloid, graph of z equals g of x and y rewritten as F equals z minus g, or a general polynomial—and feed the six numbers into the calculator to obtain a stable, rounded description of the line.
Where normal lines are needed
Multivariable calculus courses assign dozens of find-the-normal-line exercises each term: spheres, cylinders, graphs rewritten as level sets, and intersections with planes. An LMS or tutoring platform can mark the parametric coefficients by calling a deterministic oracle instead of parsing free-form student prose. Physics and engineering notebooks often need the line of steepest ascent of a potential or the geometric normal for reflection and refraction setups once partial derivatives are known from a model.
Exam generators can sample random points on textbook surfaces, compute the gradient offline, and verify learner answers against the rounded parametric fields. Keep requests small, pin the rounded gradient and parametric strings in tests, and you get reproducible normal lines for homework, edge workers, and research scripts without standing up a full computer-algebra system for a six-number geometric identity.
What you can do with it
Multivariable calculus homework
Convert a evaluated gradient and point of contact into parametric and symmetric normal-line equations for textbook surfaces without algebra slip-ups.
LMS and exam auto-grading
Score student normal-line answers against a deterministic parametric oracle that rejects zero-gradient singular points as invalid.
Geometry in notebooks and CAD prep
Emit the normal direction and unit normal at a surface sample for visualization, reflection models, or mesh diagnostics from known partials.
FAQ
How do I find the parametric normal line to a surface?
Evaluate ∇F at the point of contact and send x0, y0, z0 with fx, fy, fz.
Why is the gradient the direction of the normal line?
On a level set F=c the gradient is orthogonal to every tangent vector in the surface, so the unique line through the point parallel to ∇F is the normal line.
What if the gradient is zero at my point?
A zero gradient means the surface may be singular there and no unique normal line is defined.
Do I need to pass the formula for F itself?
No. Compute the three partial derivatives at the point offline (by hand or CAS) and pass those numbers with the point coordinates.
How long is the gradient (2, 4, 4) and what is the unit normal?
Its length is 6. Dividing each component by 6 gives the unit normal, (1, 2, 2) divided by 3, which points along the normal line but has length one.
Related tools
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/calculus/normal-line-surface \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"x0":1,"y0":2,"z0":2,"fx":2,"fy":4,"fz":4}'const res = await fetch("https://api.kit.forhosting.com/calculus/normal-line-surface", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"x0": 1,
"y0": 2,
"z0": 2,
"fx": 2,
"fy": 4,
"fz": 4
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/calculus/normal-line-surface",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"x0": 1,
"y0": 2,
"z0": 2,
"fx": 2,
"fy": 4,
"fz": 4
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/calculus/normal-line-surface", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"x0":1,"y0":2,"z0":2,"fx":2,"fy":4,"fz":4}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"x0":1,"y0":2,"z0":2,"fx":2,"fy":4,"fz":4}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/calculus/normal-line-surface", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"x0": 1,
"y0": 2,
"z0": 2,
"fx": 2,
"fy": 4,
"fz": 4
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "calculus.normal_line_surface",
"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. |
Technical notes
What the normal line is and why the gradient is its direction
A zero gradient marks a critical point of F where the surface may be singular or the level set may not define a unique tangent plane; this endpoint refuses that case with invalid_input rather than inventing an arbitrary direction.
Input contract, response shape, and validation rules
If all three gradient components are zero (within a tiny numerical tolerance), the task fails with a clear message that a zero gradient yields no unique normal line. Example: for the sphere F equals x squared plus y squared plus z squared at the point (1, 2, 2) the gradient is (2, 4, 4), the parametric line is x equals 1 plus 2t, y equals 2 plus 4t, z equals 2 plus 4t, and the unit normal is the normalized vector (1, 2, 2) over three. Pair the strings with your own plotting layer if you need a 3D sketch; this capability returns numbers and equation text only. POST a JSON body with six required finite numbers: x0, y0, and z0 for the point of contact on the surface, and fx, fy, and fz for the partial derivatives of F at that point (the components of the gradient). Short aliases are accepted: x, y, z or px, py, pz for the point; Fx, Fy, Fz or gradient_x, gradient_y, gradient_z for the gradient. Missing fields, empty strings, non-numeric values, and non-finite numbers fail with invalid_input naming the field and are not billed. On success the body echoes the cleaned point and gradient, a gradient array and a direction array (identical copies of the three partials), gradient_magnitude as the Euclidean norm of the gradient, unit_normal as the gradient divided by that magnitude, parametric_x, parametric_y, and parametric_z as human-readable component equations, parametric_vector as the compact r(t) form, symmetric as the three-part symmetric or constrained form, and a formula string restating the identity r(t) equals P0 plus t times the gradient.
Technical questions
What does the normal line to surface calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.