# Find the x & y co-ordinates symbolically from slope & area?

**URL:** <https://community.wolfram.com/t/find-the-x-y-co-ordinates-symbolically-from-slope-area/9703>\
**Category:** Questions\
**Tags:** graphics-and-visualization, interface-construction, optimization, symbolic-computations\
**Created:** [December 2, 2016, 8:13am UTC](https://community.wolfram.com/t/find-the-x-y-co-ordinates-symbolically-from-slope-area/9703 "2016-12-02T08:13:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![learebanks](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/learebanks/32/14344_2.png) [@learebanks](https://community.wolfram.com/u/learebanks)\
**Post date:** [December 2, 2016, 8:13am UTC](https://community.wolfram.com/t/find-the-x-y-co-ordinates-symbolically-from-slope-area/9703/1 "2016-12-02T08:13:43Z")

</div>

Hi All,

Quick question.  
How can you find the x & y co-ordinates symbolically from having known slope & known area?

For example:-  
If we know the area from the right angle triangle = 1400.  
And the slope = 2/360\*x.

then the answer is x = 720 & y = 4

But I am trying to setup a dynamic / Manipulate plot where I can adjust the slope.  
And as I change the slope the x & y coordinates change according to the new slope value whilst maintaining the triangle area of 1400. Therefore I was wondering if you could show me the coding to symbolically set this up.

```
DynamicModule[
 {m},
 Manipulate[Show[
   
   Plot[2/360*x, {x, 0, 1850}, Axes -> {True, True}, 
    PlotRange -> {{0, 1850}, {0, 16}}],
   Plot[m/360*x, {x, 0, 1850}, PlotStyle -> {Brown, Dashed}, 
    Axes -> {True, True}, PlotRange -> {{0, 1850}, {0, 16}}],
   
   ListPlot[{{{270, 1.5`}, {540, 3.`}, {810, 4.5`}, {1080, 
       6.`}, {1350, 7.5`}, {1620, 9.`}}, {{360, 2}, {720, 4}, {1080, 
       6}, {1440, 8}, {1800, 10}}}, PlotStyle -> {Red, Blue}, 
    Filling -> Axis],
   
   
   PlotLabel -> HoldForm["Plot of simple example AreaVsTime = degree"],
   LabelStyle -> {GrayLevel[0]}, ImageSize -> 600,
   GridLines -> {Table[i*360, {i, 10}], None},
   GridLinesStyle -> Directive[Purple, Dashed, Thin],
   Frame -> True, PlotRangePadding -> Scaled[0.02], 
   FrameTicks -> {{Table[i, {i, 0, 20, 2}], 
      Table[i, {i, 0, 15, 3}]}, {Table[i*360, {i, 10}], 
      Table[i*360, {i, 10}]}}, 
   FrameTicksStyle -> {{Blue, Red}, {Blue, Purple}},
   FrameStyle -> Directive[FontSize -> 7], 
   PerformanceGoal -> "Quality"]
  , {{m, 3, "Slope adjustment"}, 0.5, 10}]]

```

Many thanks for your help & attention.  
Best regards,  
Lea…

---

<div class="post-metadata">

**Author:** ![murray](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/murray/32/39879_2.png) [@murray](https://community.wolfram.com/u/murray)\
**Post date:** [December 2, 2016, 8:35pm UTC](https://community.wolfram.com/t/find-the-x-y-co-ordinates-symbolically-from-slope-area/9703/2 "2016-12-02T20:35:44Z")

</div>

I don’t understand your numerical example. If the triangle’s base is x = 720 and its height is y = 4, then its area would be (x y)/2 = (720\*4)/2 = 1440, not 1400. So was that a typo?

---

<div class="post-metadata">

**Author:** ![murray](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/murray/32/39879_2.png) [@murray](https://community.wolfram.com/u/murray)\
**Post date:** [December 2, 2016, 8:44pm UTC](https://community.wolfram.com/t/find-the-x-y-co-ordinates-symbolically-from-slope-area/9703/3 "2016-12-02T20:44:06Z")

</div>

Assuming it was a typo…

```
    a[m_][x_] := 1/2 x (m x)
    soln = First@Solve[a[2/360][x] == 1440 && x > 0, x];
    {x, 2/360 x} /. Last[soln]
(* {720, 4} *}

```

Readily generalizable, e.g., for lines not passing through origin, for areas not from 0 to x but from some fixed a to x, and even for some non-linear functions.

---

<div class="post-metadata">

**Author:** ![learebanks](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/learebanks/32/14344_2.png) [@learebanks](https://community.wolfram.com/u/learebanks)\
**Post date:** [December 2, 2016, 11:39pm UTC](https://community.wolfram.com/t/find-the-x-y-co-ordinates-symbolically-from-slope-area/9703/4 "2016-12-02T23:39:34Z")

</div>

Hi Murray,

Yes - sorry 1400 was a typo it should be 1440.

If you try the coding I sent within this discussion - you will see that by moving the slider in the Manipulate plot - causes the slope to change.  
I want to setup the coding so that area always remains at 1440 but the x & y coordinates change according to the new slope.  
Do you have any idea how I can set this up?

Many thanks for your help & attention.  
Lea…

---

<div class="post-metadata">

**Author:** ![neils](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/neils/32/20595_2.png) [@neils](https://community.wolfram.com/u/neils)\
**Post date:** [December 3, 2016, 1:07pm UTC](https://community.wolfram.com/t/find-the-x-y-co-ordinates-symbolically-from-slope-area/9703/5 "2016-12-03T13:07:13Z")

</div>

Using Murray’s post and turning it into a function you can get your graphic this way (if I am understanding what you want).

```
xyCoord[slope_, area_] := Module[{soln},
  soln = First@Solve[1/2 x*x*slope == area && x > 0, x];
  {x, 2/360 x} /. Last[soln]]

DynamicModule[{m, area, coords}, 
 Manipulate[coords = xyCoord[m/360, area]; 
  Show[Plot[2/360*x, {x, 0, 1850}, Axes -> {True, True}, 
    PlotRange -> {{0, 1850}, {0, 16}}], 
   Plot[m/360*x, {x, 0, 1850}, PlotStyle -> {Brown, Dashed}, 
    Axes -> {True, True}, PlotRange -> {{0, 1850}, {0, 16}}], 
   Graphics[Triangle[{{0, 0}, coords, {coords[[1]], 0}}]], 
   ListPlot[{{{270, 1.5`}, {540, 3.`}, {810, 4.5`}, {1080, 
       6.`}, {1350, 7.5`}, {1620, 9.`}}, {{360, 2}, {720, 4}, {1080, 
       6}, {1440, 8}, {1800, 10}}}, PlotStyle -> {Red, Blue}, 
    Filling -> Axis], 
   PlotLabel -> 
    HoldForm["Plot of simple example AreaVsTime = degree"], 
   LabelStyle -> {GrayLevel[0]}, ImageSize -> 600, 
   GridLines -> {Table[i*360, {i, 10}], None}, 
   GridLinesStyle -> Directive[Purple, Dashed, Thin], Frame -> True, 
   PlotRangePadding -> Scaled[0.02], 
   FrameTicks -> {{Table[i, {i, 0, 20, 2}], 
      Table[i, {i, 0, 15, 3}]}, {Table[i*360, {i, 10}], 
      Table[i*360, {i, 10}]}}, 
   FrameTicksStyle -> {{Blue, Red}, {Blue, Purple}}, 
   FrameStyle -> Directive[FontSize -> 7], 
   PerformanceGoal -> "Quality"], {{m, 3, "Slope adjustment"}, 0.5, 
   10, Appearance -> "Labeled"}, {{area, 1440, "area"}, 10, 1800, 
   Appearance -> "Labeled"}]]

```

---

<div class="post-metadata">

**Author:** ![learebanks](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/learebanks/32/14344_2.png) [@learebanks](https://community.wolfram.com/u/learebanks)\
**Post date:** [December 5, 2016, 8:03am UTC](https://community.wolfram.com/t/find-the-x-y-co-ordinates-symbolically-from-slope-area/9703/6 "2016-12-05T08:03:04Z")

</div>

Hi Neil,

Many thanks for your excellent coding - really helpful & much appreciated.

Best regards,  
Lea…
