3D Geometry Calculator

Distance, Section Formula, Direction Cosines & Angle Between Lines

Point P

Point Q

Point A

Point B

Line Direction (or two points)

Enter direction ratios; the calculator normalises to direction cosines.

Line 1 direction

Line 2 direction

Quick Answer – What is 3D Coordinate Geometry?

3D Coordinate Geometry extends Cartesian coordinates to three dimensions (x, y, z). It provides formulas for distance between two points, section formula for dividing a line segment, direction cosines that describe a line's orientation, and the angle between two lines using their direction ratios.

Key Formulas

Distance: PQ = √[(x2−x1)² + (y2−y1)² + (z2−z1)²]
Section (internal): P = ((mx2+nx1)/(m+n), (my2+ny1)/(m+n), (mz2+nz1)/(m+n))
Direction cosines: l = a/√(a²+b²+c²), m = b/√(…), n = c/√(…)
Angle θ: cosθ = |a1a2+b1b2+c1c2| / (√(a1²+…) √(a2²+…))

Solved Examples

Example 1: Distance between (1,2,3) and (4,6,3)

= √[(4-1)²+(6-2)²+(3-3)²] = √(9+16+0) = 5

Example 2: Section formula (1,2,3) and (4,5,6) with ratio 1:2

x = (1×4+2×1)/3 = 2, y = (1×5+2×2)/3 = 3, z = (1×6+2×3)/3 = 4

Example 3: Angle between lines (1,0,0) and (0,1,0)

cosθ = 0 → θ = 90°

Frequently Asked Questions

Q1. Can I use negative coordinates?
Yes, all inputs accept negative numbers and decimals.
Q2. What is the difference between direction ratios and cosines?
Direction ratios are proportional to the direction cosines. The cosines are the actual cosines of the angles the line makes with the x, y, z axes.
Q3. Does the angle between lines always give an acute angle?
Yes, the formula uses the absolute value of the dot product, so the result is between 0° and 90°.
Q4. Can I compute external division with the section formula?
For external division, use a negative ratio (e.g., m:n with n negative). The calculator will handle the sign.
Q5. How precise are the results?
Results are shown to 4 decimal places.