I want to scale transform the equation (not the graph) of a circle. Specifically, I want to scale 4x by the x-axis and 3x by the y-axis. I use the following
x^2 + y^2 == 1 /. Thread[{x, y} -> ScalingTransform[{4, 3}][{x, y}]]
The result is 16x^2 + 9y^2 == 1 and it is wrong. How to get the correct result of (x^2)/16 + (y^2)/9 == 1?
2 Answers
The simple
x^2 + y^2 == 1 /.
Thread[{x, y} -> ScalingTransform[{1/4, 1/3}][{x, y}]]
yields
x^2/16 + y^2/9 == 1
-
$\begingroup$ This easy fix loses generality. If I want to rotate the parabola for 60 degree, the following
y==x^2+2x-3 /. Thread[{x, y} -> RotationTransform[Pi/3, {0,0}][{x, y}]]
gives the equation after -60 degree rotation. Is there a more general way to fix the rotation and scaling problem and produce the correct equation, instead of the opposite equation? $\endgroup$– RichardMar 10, 2022 at 2:00 -
2$\begingroup$ @Richard with all due respect, the question of the OP is fully answered in my opinion.
ScalingTransform
was reported to cause some unwanted behavior and I provided an answer to that. I could NOT have guessed what you mentioned in your comment as you understand. If you are interested inRotationTransform
perhaps you could update the OP and describe that as well in a nice context -as you did for the original question- or start a new thread. I think that this is good practice for other users as well. $\endgroup$– user49048Mar 10, 2022 at 2:04 -
1$\begingroup$ @Richard I'd venture the guess that
-Pi/3
would give the intended result. In general it seems that taking the inverse of transformation should give you what you want. $\endgroup$ Mar 10, 2022 at 11:16
I think you're mixing up active and passive transformations. It looks to me that Mathematica's definition for Thread[{x, y} ->ScalingTransform[{4, 3}][{x, y}]]
is to replace x
with 4x
and y
with 3y
, which is an active transformation.
In your original post, you say that you want to "scale 4x by the x-axis and 3x by the y-axis," which I believe you are conceptualising as a passive transformation. The active transformation which achieves this effect is to replace x
with x/4
and y
with y/3
, as described in @kcr's answer. This change of perspective also solves your problem with RotationTransform
in the comments.
f[x_,y_]=x^2+y^2-1
. $\endgroup$