Tangent length from external point
Find how long the tangent is from a point outside a circle to the spot where it touches: a radius of 3 and a distance of 5 from the centre give a tangent of 4. Points inside or on the circle are rejected. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Radius
- 3
- Distance
- 5
- Tangent length
- 4
- Tangent length squared
- 16
When a line from a point outside a circle just grazes the circle, the segment from that external point to the contact point is a tangent segment. Its length depends only on the circle radius and how far the point sits from the center: L equals the square root of d squared minus r squared. Students meet this identity in Euclidean geometry, coordinate geometry, and exam problems that ask for the length of a tangent drawn from a given external point. This calculator accepts radius r and center-to-point distance d, returns the tangent length with a short formula string, and rejects interior points where no real tangent exists.
What the tangent length formula means
Consider a circle with center O and radius r, and a point P outside the circle so that the distance OP equals d with d strictly greater than r. From P you can draw two congruent tangents that touch the circle at points T and T prime. Focus on one contact point T.
The radius OT is perpendicular to the tangent line at T, so triangle OTP is right-angled at T. Pythagoras then gives OT squared plus PT squared equals OP squared, which is r squared plus L squared equals d squared. Solving for the tangent segment yields L equals the square root of d squared minus r squared.
That single radical is the entire computation: no iterative root finding, no angle tables, and no dependence on where P sits angularly around the circle—only the radial distance matters. Radius must be positive so the circle is non-degenerate. Together these checks mirror the geometric hypotheses of the theorem and keep client code free of silent imaginary results.
Who uses the tangent length
Classrooms and tutoring platforms use a tangent length calculator so learners can check L equals square root of d squared minus r squared for arbitrary positive r and d without arithmetic slips. Exam generators and LMS auto-graders need a deterministic oracle that marks interior points as invalid instead of inventing a length. Drafting and CAD helpers sometimes need the free length of a tangent from a known exterior point when only center distance and radius are available before coordinates are fully placed.
Failed validation does not consume balance.
What you can do with it
Classroom and homework checks
Let students submit radius r and center distance d and verify L = √(d²−r²) against textbook Pythagorean checks for external points.
CAD and geometry notebooks
Compute free tangent segment length from center distance and radius in scripts without importing a full computational-geometry library.
FAQ
How do I calculate the tangent length from an external point?
Send positive finite numbers radius (r) and distance (d) with d > r.
What happens if the point is inside the circle?
No real tangent from an interior point exists, and the failure is not billed.
What if the point lies on the circle (d = r)?
An external point requires d strictly greater than r; on-circle points are not treated as having a positive external tangent segment.
Does the answer depend on the angle of the point around the circle?
No. Only the radial distance d and radius r matter. All points on the same concentric circle of radius d share the same tangent length.
How many tangents can be drawn from an outside point, and are they the same length?
Two, one touching each side of the circle, and both have exactly the same length. The result is that shared length, so you only need to calculate it once.
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/geom/tangent-length-point \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"radius":3,"distance":5}'const res = await fetch("https://api.kit.forhosting.com/geom/tangent-length-point", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"radius": 3,
"distance": 5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/tangent-length-point",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"radius": 3,
"distance": 5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/tangent-length-point", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"radius":3,"distance":5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"radius":3,"distance":5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/tangent-length-point", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"radius": 3,
"distance": 5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.tangent_length_point",
"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 tangent length formula means
When d equals r the point lies on the circumference and the formal radical collapses to zero, but there is no proper external tangent segment in the usual school sense, so this capability requires d greater than r and returns invalid_input for points on the circle.
Input contract, response shape, and error behaviour
If distance is less than radius the point lies inside the circle and the task fails with a message that the point is interior and tangent length is not defined. If distance equals radius the point lies on the circle and the task fails because an external point is required. Classic textbook values work as expected: radius three and distance five yield tangent length four, because three-four-five is a Pythagorean triple with the radius and tangent as legs and the center-to-point segment as hypotenuse. POST a JSON body with two required finite numbers: radius, the positive circle radius r, and distance, the positive distance d from the center to the external point. Each field may arrive as a JSON number or as a numeric string; missing fields, empty strings, and non-finite values fail with invalid_input naming the field. If radius is not strictly positive the request is rejected. If distance is not strictly positive the request is rejected. None of those validation failures consume prepaid balance. On success the body echoes radius and distance, returns tangent_length rounded to twelve decimal places for stable goldens across runtimes, returns tangent_length_squared as the exact intermediate d squared minus r squared (also rounded for display stability), and includes formula as the string L equals square root of d squared minus r squared. Pair the numeric result with your own diagram if you need a sketch of O, P, and T; this endpoint computes length only and does not emit coordinates of the contact points.
Where a tangent-length API earns its keep
Keep requests small, pin the rounded tangent_length in tests, and you get reproducible lengths for homework, LMS plugins, and edge workers without standing up a geometry engine of your own.
Integration use cases
Exam and LMS auto-grading
Mark tangent-length items with a deterministic oracle that rejects interior points (d < r) and on-circle points (d = r) as invalid_input.
Technical questions
What does the tangent length calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.