TransWikia.com

How to draw the figure of $frac{x-1}{2}=frac{y-1}{3}=frac{z-2}{3}$-type straight line

Mathematica Asked on April 13, 2021

I’d like to draw the straight line that is expressed in symmetrical form directly: $frac{x-1}{2}=frac{y-1}{3}=frac{z-2}{3}$

ContourPlot3D[(x - 1)/2 == (y - 1)/3 == (z - 2)/3, {x, -5, 5}, {y, -5,
   5}, {z, -5, 5}, BoxRatios -> Automatic]

But I can’t get the correct result with the above code. How can I draw this line directly?

In addition, $frac{x-1}{2}=frac{y-1}{3}=2$ should represent a vertical line, which I hope can be drawn by built-in or custom functions.

2 Answers

ContourPlot3D[(x - 1)/2 == (y - 1)/3, {x, -5, 5}, {y, -5, 5}, {z, -5, 
  5}, MeshFunctions -> Function[{x, y, z}, (y - 1)/3 - (z - 2)/3], 
 Mesh -> {{0}}, MeshStyle -> {Red, Thick}, ContourStyle -> None, 
 BoundaryStyle -> None, BoxRatios -> Automatic]

Or

Solve[(x - 1)/2 == (y - 1)/3 == (z - 2)/3 == t, {x, y, z}];
ParametricPlot3D[{x, y, z} /. %, {t, 0, 5}]

Correct answer by cvgmt on April 13, 2021

DiscretizeRegion[ImplicitRegion[(x-1)/2==(y-1)/3==(z-2)/3,{x,y,z}]]

Or

line=InfiniteLine[{a,b,c},{d,e,f}];
line/.FindInstance[RegionEqual[ImplicitRegion[(x-1)/2==(y-1)/3==(z-2)/3,{x,y,z}],line],{a,b,c,d,e,f}]
Graphics3D[%]

Answered by chyanog on April 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP