Message Boards Message Boards

0
|
1454 Views
|
4 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Why hasn't the distance from this point to the straight line been calculated?

Posted 10 months ago
Clear["Global`*"]

reg = ImplicitRegion[ x + k y == 0, {x, y}]

pt = {-((a^2 k)/Sqrt[b^2 + a^2 k^2]), b^2/Sqrt[b^2 + a^2 k^2]}

RegionDistance[reg, pt]

Use codes above all
Why is it impossible to find the distance from this point to the straight line?

The known condition is: a > b > 0, and the point is in the first quadrant. k<0

POSTED BY: Lee Tao
4 Replies

Give up on ImplicitRegion:

reg = InfiniteLine[{x, y} /.
    Solve[a x + b y + c == 0, y][[1]] /.
   {{x -> 0}, {x -> 1}}]
RegionDistance[reg,
 {x0, y0}]
POSTED BY: Gianluca Gorni

I don't know, but this variant works correctly:

reg = InfiniteLine[{{0, 0}, {-k, 1}}];
pt = {-((a^2 k)/Sqrt[b^2 + a^2 k^2]),
   b^2/Sqrt[b^2 + a^2 k^2]};
RegionDistance[reg, pt]
POSTED BY: Gianluca Gorni
Posted 10 months ago

Thank you! This is an alternative method.

POSTED BY: Lee Tao
Posted 10 months ago

Using this code to derive the distance from a point to a straight line is also unsuccessful.

Clear["Global`*"]

reg = ImplicitRegion[a x + b y + c == 0, {x, y}]

pt = {x0, y0}

RegionDistance[reg, pt]

Is there any method to derive the distance formula from a point to a straight line?

POSTED BY: Lee Tao
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract