Start with the original example v = ⟨−8, 6⟩. Its length is 10, while its unit vector is u = ⟨−0.8, 0.6⟩. The negative first component still points left and the positive second component still points up. The calculation changes the length to one while retaining the direction.

Divide both components by the same magnitude
For a nonzero plane vector, compute its magnitude and divide each component by it. OpenStax defines this normalization and distinguishes the direction effects of positive and negative scalar multiplication. Vectors in the plane
Keep three labeled lines in your calculation record:
| Quantity | Calculation for this example | Result |
|---|---|---|
| Original magnitude | √((−8)² + 6²) = √100 | 10 |
| Unit components | ⟨−8/10, 6/10⟩ | ⟨−0.8, 0.6⟩ |
| Unit-length check | √((−0.8)² + 0.6²) = √1 | 1 |
Squaring makes the original magnitude positive; it does not make the normalized x-component positive. Dividing by the positive length preserves the signs in this nonzero example. If a calculator returns ⟨0.8, 0.6⟩, it has changed the direction.
Do not divide by the sum of the components. Here that sum is −2, which would produce a different vector and fail the unit-length check. Keep the magnitude expression beside the result so the denominator is explicit.
Compare a larger vector and a reversed vector
Use two further original cases to test what the answer means:
| Input | Magnitude | Unit vector | Comparison with the starting case |
|---|---|---|---|
| ⟨−8, 6⟩ | 10 | ⟨−0.8, 0.6⟩ | Starting direction |
| ⟨−16, 12⟩ | 20 | ⟨−0.8, 0.6⟩ | Same direction, twice the original length |
| ⟨8, −6⟩ | 10 | ⟨0.8, −0.6⟩ | Opposite direction |
The first two inputs normalize to the same result even though they are not equal vectors. Their magnitudes differ. The third input reverses both signs; its normalized direction reverses too. A comparison ledger should retain each input instead of showing only identical unit components and losing the distinction that led to them.
For the companion plot, put both arrows at the origin on labeled abstract x/y axes. Use one coordinate scale with equal horizontal and vertical units. Label the original endpoint and the normalized endpoint, and keep the numerical table available beside it. The unit arrow will be much shorter in the starting example. Enlarging it independently without declaring a different scale would hide the length comparison.
This is a plane-coordinate exercise. Its arrows do not establish a real force, allowable load, speed, or equipment setting. The record answers a direction-and-length question using the supplied components.
Treat missing input and zero as different states
The companion workbench accepts two finite numeric components, each from −1000 through 1000 inclusive. That is a deliberate limit for this example, not a mathematical restriction on all plane vectors.
An explicit ⟨0, 0⟩ has magnitude zero and cannot be normalized by division by its magnitude. Show No normalized direction for the zero vector, without manufacturing ⟨0, 0⟩ as a unit result. A zero in one component is different: a nonzero axis-aligned vector still has a direction. Nonzero normalization rule
A blank field is missing input. Do not silently convert it to zero. Reject nonnumeric text, nonfinite values, and components outside the example's bounds. For every invalid or incomplete state, clear the previous current answer, length check, and result arrows. Otherwise a correct answer for yesterday's input can appear to answer today's invalid entry.
For valid input, keep full internal precision through normalization and the numerical length check. Label displayed decimals as rounded when applicable. The mathematical normalized length is one; a floating-point implementation needs a stated tolerance for its numerical check, not a promise that every computed value will equal one exactly. Do not use already-rounded displayed components as the calculation's hidden source.
Use the controls to compare inputs
The companion provides Compute, the three labeled example presets, and Reset. Editing a component or choosing a preset clears the current derived result until Compute validates and calculates the new pair. A completed calculation can add a clearly labeled input/result row to the session comparison ledger; that history must not masquerade as the current answer.
Reset restores ⟨−8, 6⟩, clears the comparison history, messages, and derived output, and waits for Compute. The plot and the text result must describe the same validated input. Use these conditions to check any changes you make to the companion.
Copyable unit-vector workbench prompt
Create one complete, self-contained US-English HTML companion for “Unit vector calculator — direction & length”. Return the full HTML document, with inline CSS and any JavaScript needed for the local interactions. Use the original scenario, named records, numbers and expected cases below.
Design the page for this task: use clearly labeled input or source records, a readable result or worked example, and an adjacent explanation of the evidence. Use a restrained visual hierarchy, left-aligned text, readable tables or stacked records, and a responsive layout at 720px and 360px. Provide meaningful labeled controls for Compute unit vector; Reset; Original ⟨−8, 6⟩; Double ⟨−16, 12⟩; Reverse ⟨8, −6⟩. Use keyboard-accessible native controls and visible focus. Keep the complete content readable without an external dependency.
The following brief supplies the substantive content and constraints. Native-format requests describe the material to represent or copy manually; this HTML must not pretend to create DOCX, XLSX, PDF, PPTX, H5P or another native file, run Python/Flask/Django/Snowflake/Power BI, connect a live service, send messages, or perform an authorized real-world action. Where the task requires a native source, actual observation or separate approval, retain that requirement and leave unsupplied evidence blank.
Prepare an original two-dimensional unit-vector workbench specification and readable calculation record. Implement the calculator and plot against these cases without claiming unperformed runtime tests.
Accept two numeric components x and y, each finite and within -1000 through 1000 inclusive. Reject blank, nonnumeric, nonfinite, and out-of-range input without silently converting missing fields to zero. For an explicit zero vector, report that there is no normalized direction and do not divide by zero.
For a valid nonzero vector, calculate magnitude m = sqrt(x*x + y*y), then u = <x/m, y/m>. Show the original components, original magnitude, normalized components, and a separate unit-length check. Retain internal precision; label rounded displays and require a documented numerical tolerance rather than exact universal floating-point equality.
Use these original acceptance cases:
<-8,6>: magnitude 10, unit vector <-0.8,0.6>.
<-16,12>: magnitude 20, the same unit vector <-0.8,0.6>.
<8,-6>: magnitude 10, reversed unit vector <0.8,-0.6>.
<0,0>: no normalized result.
Explain that same normalized direction does not make the first two original vectors equal. Keep signs and divide by magnitude, not by the sum of components.
Propose original and normalized arrows from a common origin on labeled abstract axes with one equal-unit coordinate scale. Include labeled endpoints and a readable text/table equivalent; do not silently enlarge the normalized arrow on an independent scale.
Specify Compute, three labeled presets, and Reset. Input edits and preset changes clear the current result until Compute. Invalid input clears prior current output and arrows. Keep completed comparison rows separate from the current answer. Reset restores <-8,6>, clears comparison history and derived output, and waits for Compute.
Return the input rules, step-by-step fixture calculations, comparison ledger, plot plan, control-state acceptance checks, and pending production checklist. Do not add three-dimensional, force-sizing, safety, learning-performance, storage, or runtime guarantees.
COMPLETE AUTHORED SCENARIO AND EXPECTED CASES
The following is the supplied reading/teaching/calculation record to represent in the companion. Preserve its particular content, examples, source references and unknowns. Wording about a future native implementation refers to that native task, not permission to omit this HTML companion.
# Unit Vector Calculator: Keep the Direction, Separate the Length
You enter a vector and get two small decimals back. Are those a new endpoint, the original length, or a direction? A useful unit vector calculator keeps the input, its magnitude, and the normalized components visible together so the answer can be checked.
Start with the original example **v = ⟨−8, 6⟩**. Its length is 10, while its unit vector is **u = ⟨−0.8, 0.6⟩**. The negative first component still points left and the positive second component still points up. The calculation changes the length to one while retaining the direction.
## Divide both components by the same magnitude
For a nonzero plane vector, compute its magnitude and divide each component by it. OpenStax defines this normalization and distinguishes the direction effects of positive and negative scalar multiplication. [Vectors in the plane](https://openstax.org/books/calculus-volume-3/pages/2-1-vectors-in-the-plane)
Keep three labeled lines in your calculation record:
| Quantity | Calculation for this example | Result |
| --- | --- | --- |
| Original magnitude | √((−8)² + 6²) = √100 | 10 |
| Unit components | ⟨−8/10, 6/10⟩ | ⟨−0.8, 0.6⟩ |
| Unit-length check | √((−0.8)² + 0.6²) = √1 | 1 |
Squaring makes the original magnitude positive; it does not make the normalized x-component positive. Dividing by the positive length preserves the signs in this nonzero example. If a calculator returns ⟨0.8, 0.6⟩, it has changed the direction.
Do not divide by the sum of the components. Here that sum is −2, which would produce a different vector and fail the unit-length check. Keep the magnitude expression beside the result so the denominator is explicit.
## Compare a larger vector and a reversed vector
Use two further original cases to test what the answer means:
| Input | Magnitude | Unit vector | Comparison with the starting case |
| --- | --- | --- | --- |
| ⟨−8, 6⟩ | 10 | ⟨−0.8, 0.6⟩ | Starting direction |
| ⟨−16, 12⟩ | 20 | ⟨−0.8, 0.6⟩ | Same direction, twice the original length |
| ⟨8, −6⟩ | 10 | ⟨0.8, −0.6⟩ | Opposite direction |
The first two inputs normalize to the same result even though they are not equal vectors. Their magnitudes differ. The third input reverses both signs; its normalized direction reverses too. A comparison ledger should retain each input instead of showing only identical unit components and losing the distinction that led to them.
For the companion plot, put both arrows at the origin on labeled abstract x/y axes. Use one coordinate scale with equal horizontal and vertical units. Label the original endpoint and the normalized endpoint, and keep the numerical table available beside it. The unit arrow will be much shorter in the starting example. Enlarging it independently without declaring a different scale would hide the length comparison.
This is a plane-coordinate exercise. Its arrows do not establish a real force, allowable load, speed, or equipment setting. The record answers a direction-and-length question using the supplied components.
## Treat missing input and zero as different states
The companion workbench accepts two finite numeric components, each from −1000 through 1000 inclusive. That is a deliberate limit for this example, not a mathematical restriction on all plane vectors.
An explicit ⟨0, 0⟩ has magnitude zero and cannot be normalized by division by its magnitude. Show **No normalized direction for the zero vector**, without manufacturing ⟨0, 0⟩ as a unit result. A zero in one component is different: a nonzero axis-aligned vector still has a direction. [Nonzero normalization rule](https://openstax.org/books/calculus-volume-3/pages/2-1-vectors-in-the-plane)
A blank field is missing input. Do not silently convert it to zero. Reject nonnumeric text, nonfinite values, and components outside the example's bounds. For every invalid or incomplete state, clear the previous current answer, length check, and result arrows. Otherwise a correct answer for yesterday's input can appear to answer today's invalid entry.
For valid input, keep full internal precision through normalization and the numerical length check. Label displayed decimals as rounded when applicable. The mathematical normalized length is one; a floating-point implementation needs a stated tolerance for its numerical check, not a promise that every computed value will equal one exactly. Do not use already-rounded displayed components as the calculation's hidden source.
## Use the controls to compare inputs
The companion provides Compute, the three labeled example presets, and Reset. Editing a component or choosing a preset clears the current derived result until Compute validates and calculates the new pair. A completed calculation can add a clearly labeled input/result row to the session comparison ledger; that history must not masquerade as the current answer.
Reset restores ⟨−8, 6⟩, clears the comparison history, messages, and derived output, and waits for Compute. The plot and the text result must describe the same validated input. Use these conditions to check any changes you make to the companion.
Implement the local companion rather than returning a text-only plan. Preserve every numerical fixture and the distinction between illustrative expectations and actual evidence. Any native-runtime or classroom tests mentioned above remain tests to perform in the proper environment; do not mark them passed. Keep edits and practice responses in this open page only, without claiming persistent storage. Provide invalid/missing-input feedback and reset behavior that agree with this specific brief. Do not claim accessibility certification, learning gains, real approvals or test results that were not observed.
A separate place to view a prepared example
Keep the calculation trace and input/result ledger as the primary explanation. The HTML companion is available above for comparison with the original records. Its numerical behavior and controls still need to be checked against the cases above in the actual example.
A checked answer should tell you both which way the vector points and which original length was removed to make it a unit vector.