# Q: Trying to make fixed-area draggable triangle. Want to constrain point to stay on a parallel line

Dear Desmos CL folks,

I am trying to make a fixed-area draggable triangle. The corners would be draggable, but constrained such that the base and height are left unchanged. In other words, each dragged corner should be constrained to move along the line parallel to the one connecting the other two corners.

Here’s an unsuccessful attempt, which is what I have so far:

In that, I have the line going through point C that is parallel to the side AB, but I haven’t been able to constrain C’s drag such that it is forced to move along that fixed line, without the line itself also getting moved.

Desmos makes it easy to force a point’s drag to stay on a circle, or a single fixed x-coord or a single fixed y-coord. So, I figure it should be possible to force a point to stay on a fixed oblique line in the x-y plane. I don’t know how, though!

Any help greatly appreciated!

Ra

You can define the line you wish for a point to be fixed to as a function, and then any coordinate (x_1, f(x_1)) or similar should be fixed to that line. For instance, f(x)=mx+3 where m is defined as (A.y-B.y)/(A.x-B.x) gives you a point fixed to a line parallel to AB, albeit fixed in vertical position - you could fix that by dynamically varying the y-intercept too.

I think you will run into dependency problems if you try to make all point movements dependent on the positions of the other two points - possibly better to have one “free” point and the other two dependent on that.

1 Like

In case the previous answer wasn’t explicit enough, here’s a graph that implements what you described. Graphing Calculator

I had a play a little further and I think this is the best I could come up with:

You might be able to have a look at some of the tricks I’ve used and harvest them to improve on it.

Specifically, I know there must be an exact science on what makes Desmos create a draggable point rather than a fixed one, but I haven’t quite worked out the full logic yet. However, a good trick seems to be to write things in ‘coordinate parametric’ form with a variable other than t - for example, using your original graph:

`C2=C+t v_ab` ==> gives a straight line
`C2=C+p v_ab` ==> gives a fixed point, moveable only by adjusting the slider p
`C2=(C.x + p v_ab.x, C.y + p.v_ab.y)` ==> gives a draggable point fixed to the straight line, where p updates according to the position of the point

Thanks to both of you for the excellent suggestions and examples. It’s interesting that decomposing the vector into its x and y components helps.

I don’t think there is any logical circularity inherent in having a triangle such that each vertex can only be moved parallel to its opposite edge. However, I can see why a dependency-loop checker might object to it, and that indeed appears to be what Desmos is doing.

I tried making such a triangle in the Desmos geometry module too, and also in GeoGebra (which I am less familiar with), but so far without success.

I think that a drag-any-vertex-to-shear area-preserving triangle of this sort would be fun and potentially instructive for students to play with, but if it turns out to be too self-referential-looking for Desmos to allow then that’s ok.

Thanks again,

Raj