-3
$\begingroup$

Question:

Ask and be perpendicular to the straight line of $y = x -1$ and lead the straight line equation that cross a point {4,3}.

My method is:

{eqn = y == x - 1, pt = {4, 3}}
eq = # == 0 &@(eq /. Equal -> Subtract)
line = Cross@(Coefficient[eq[[1]], #] & /@ {x, y}) . {x, y} + c == 0
sol = First@(line /. Thread[{x, y} -> pt] // Solve)
line = line /. sol // Simplify // SubtractSides

This point may not necessarily lie on the original line. For example, a line that is perpendicular to the line y == x - 1 and passes through the point {6, 9}.

-15 + x + y == 0

Are there other methods to solve this problem?

$\endgroup$

2 Answers 2

3
$\begingroup$

You can try

Clear["Global`*"]
d := x - y - 1;
n = {Coefficient[d, y], -Coefficient[d, x]};
ptA = {4, 3};
ptB = {6, 9};
ptM = {x, y};
Expand[n . (ptM - ptA) == 0]
Expand[n . (ptM - ptB) == 0]

7 - x - y == 0

15 - x - y == 0

$\endgroup$
0
$\begingroup$

Once again, I don't see your effort in understanding the code you've copied/obtained. (-1)

ImplicitRegion:

How to find the distance from this point to a straight line?

How can I deduce the distance formula from a point to a straight line?

How to make moving point and moving circle play automatically?The locus of points is hyperbolic?

How to optimize the two tangents of a circle by passing through a point outside the circle and calculate the sine value of the angle?

How to make moving point and moving circle play automatically?

GeometricTransformation+RotationTransform:

https://mathematica.stackexchange.com/q/307268/1871

RegionConvert:

https://mathematica.stackexchange.com/a/284167/1871

reg = ImplicitRegion[y == x - 1, {x, y}];

reg2 = GeometricTransformation[reg, RotationTransform[Pi/2, {4, 3}]];

RegionConvert[reg2, "Implicit"]

enter image description here

RegionMember:

Are the inscribed circle equations calculated by these two different lines of code equal?

https://mathematica.stackexchange.com/a/284174/1871

https://mathematica.stackexchange.com/a/307315/1871

reg = ImplicitRegion[y == x - 1, {x, y}];

reg2 = GeometricTransformation[reg, RotationTransform[Pi/2, {x0, y0}]];

reg3 = RegionConvert[reg2, "Implicit"]

cond = RegionMember[reg3, {6, 9}]

Simplify[reg3[[1]], cond]

enter image description here


Another method using functions appearing in/under your questions only. CoefficientArrays:

How to simplify the formula under the quadratic root sign?

How to optimize the code for deriving the standard equation of the Apollonian circle?

How to optimize the code for solving the Apollonian circle equation?

InfiniteLine:

What are other methods to find the distance from point P(x0,y0) to the line determined by points A(x1,y1) and B(x2,y2)?

How to draw the trajectory of the circumscribed rectangle of an ellipse and determine the area range of the rectangle?

How to optimize the tangent equation of a curve at a certain point?

RegionConvert[
 InfiniteLine[{6, 9}, 
  CoefficientArrays[y == x - 1, {x, y}][[-1]]], "Implicit"]

enter image description here

$\endgroup$
4
  • $\begingroup$ This point may not necessarily lie on the original line. Of course, this example is quite special, as this point happens to be on the line. If the point does not lie on the line, it would not apply. $\endgroup$
    – csn899
    Commented Sep 29 at 13:02
  • $\begingroup$ @csn899 Everything needed is there, once again I don't see your effort in understanding the code you've copied/obtained, sadly I can't downvote twice. $\endgroup$
    – xzczd
    Commented Sep 29 at 13:23
  • $\begingroup$ How to convert the equation of a line to use standard 'x, y' notation instead of using symbols with dots underneath them? $\endgroup$
    – csn899
    Commented Sep 29 at 23:17
  • $\begingroup$ @csn899 I repeat: everything needed is there. $\endgroup$
    – xzczd
    Commented Sep 30 at 0:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.