How to plot a triangle given three side lengths?












0












$begingroup$


I am trying to create a program for a school project where I need to plot points of a triangle given all 3 side lengths (a=10, b=20, c=30).
I tried the solution from the other topic and it didn't work since the result produced was C(20,0) and that cant be right since one of the sides is already placed on the axis and its not a right triangle.



Is there a formula I can plug into my program that will produce point C, given that I place A and B on x or y axis and will work with any triangle?



Thank you.










share|cite|improve this question









$endgroup$








  • 6




    $begingroup$
    There is no triangle with sides such that $a+b=c$.
    $endgroup$
    – AugSB
    Dec 18 '18 at 20:48






  • 1




    $begingroup$
    It gave you that answer because that was the correct answer. A triangle with $a= 10, b = 20, c = 30$ is not a right triangle because $10^2 + 20^2 ne 30^2$. A triangle with side $a=10, b=20, c=30$ is not a triangle at all but an straight line segment.
    $endgroup$
    – fleablood
    Dec 18 '18 at 20:54










  • $begingroup$
    You can read up on Triangle Inequality if you want... It seems that sometimes we refer to this case as a degenerate triangle which I think of (and seems to be the common parlance) as more of a line segment than a triangle.
    $endgroup$
    – Mason
    Dec 18 '18 at 21:00


















0












$begingroup$


I am trying to create a program for a school project where I need to plot points of a triangle given all 3 side lengths (a=10, b=20, c=30).
I tried the solution from the other topic and it didn't work since the result produced was C(20,0) and that cant be right since one of the sides is already placed on the axis and its not a right triangle.



Is there a formula I can plug into my program that will produce point C, given that I place A and B on x or y axis and will work with any triangle?



Thank you.










share|cite|improve this question









$endgroup$








  • 6




    $begingroup$
    There is no triangle with sides such that $a+b=c$.
    $endgroup$
    – AugSB
    Dec 18 '18 at 20:48






  • 1




    $begingroup$
    It gave you that answer because that was the correct answer. A triangle with $a= 10, b = 20, c = 30$ is not a right triangle because $10^2 + 20^2 ne 30^2$. A triangle with side $a=10, b=20, c=30$ is not a triangle at all but an straight line segment.
    $endgroup$
    – fleablood
    Dec 18 '18 at 20:54










  • $begingroup$
    You can read up on Triangle Inequality if you want... It seems that sometimes we refer to this case as a degenerate triangle which I think of (and seems to be the common parlance) as more of a line segment than a triangle.
    $endgroup$
    – Mason
    Dec 18 '18 at 21:00
















0












0








0





$begingroup$


I am trying to create a program for a school project where I need to plot points of a triangle given all 3 side lengths (a=10, b=20, c=30).
I tried the solution from the other topic and it didn't work since the result produced was C(20,0) and that cant be right since one of the sides is already placed on the axis and its not a right triangle.



Is there a formula I can plug into my program that will produce point C, given that I place A and B on x or y axis and will work with any triangle?



Thank you.










share|cite|improve this question









$endgroup$




I am trying to create a program for a school project where I need to plot points of a triangle given all 3 side lengths (a=10, b=20, c=30).
I tried the solution from the other topic and it didn't work since the result produced was C(20,0) and that cant be right since one of the sides is already placed on the axis and its not a right triangle.



Is there a formula I can plug into my program that will produce point C, given that I place A and B on x or y axis and will work with any triangle?



Thank you.







geometry trigonometry triangle






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Dec 18 '18 at 20:42









Stand StudiosStand Studios

1




1








  • 6




    $begingroup$
    There is no triangle with sides such that $a+b=c$.
    $endgroup$
    – AugSB
    Dec 18 '18 at 20:48






  • 1




    $begingroup$
    It gave you that answer because that was the correct answer. A triangle with $a= 10, b = 20, c = 30$ is not a right triangle because $10^2 + 20^2 ne 30^2$. A triangle with side $a=10, b=20, c=30$ is not a triangle at all but an straight line segment.
    $endgroup$
    – fleablood
    Dec 18 '18 at 20:54










  • $begingroup$
    You can read up on Triangle Inequality if you want... It seems that sometimes we refer to this case as a degenerate triangle which I think of (and seems to be the common parlance) as more of a line segment than a triangle.
    $endgroup$
    – Mason
    Dec 18 '18 at 21:00
















  • 6




    $begingroup$
    There is no triangle with sides such that $a+b=c$.
    $endgroup$
    – AugSB
    Dec 18 '18 at 20:48






  • 1




    $begingroup$
    It gave you that answer because that was the correct answer. A triangle with $a= 10, b = 20, c = 30$ is not a right triangle because $10^2 + 20^2 ne 30^2$. A triangle with side $a=10, b=20, c=30$ is not a triangle at all but an straight line segment.
    $endgroup$
    – fleablood
    Dec 18 '18 at 20:54










  • $begingroup$
    You can read up on Triangle Inequality if you want... It seems that sometimes we refer to this case as a degenerate triangle which I think of (and seems to be the common parlance) as more of a line segment than a triangle.
    $endgroup$
    – Mason
    Dec 18 '18 at 21:00










6




6




$begingroup$
There is no triangle with sides such that $a+b=c$.
$endgroup$
– AugSB
Dec 18 '18 at 20:48




$begingroup$
There is no triangle with sides such that $a+b=c$.
$endgroup$
– AugSB
Dec 18 '18 at 20:48




1




1




$begingroup$
It gave you that answer because that was the correct answer. A triangle with $a= 10, b = 20, c = 30$ is not a right triangle because $10^2 + 20^2 ne 30^2$. A triangle with side $a=10, b=20, c=30$ is not a triangle at all but an straight line segment.
$endgroup$
– fleablood
Dec 18 '18 at 20:54




$begingroup$
It gave you that answer because that was the correct answer. A triangle with $a= 10, b = 20, c = 30$ is not a right triangle because $10^2 + 20^2 ne 30^2$. A triangle with side $a=10, b=20, c=30$ is not a triangle at all but an straight line segment.
$endgroup$
– fleablood
Dec 18 '18 at 20:54












$begingroup$
You can read up on Triangle Inequality if you want... It seems that sometimes we refer to this case as a degenerate triangle which I think of (and seems to be the common parlance) as more of a line segment than a triangle.
$endgroup$
– Mason
Dec 18 '18 at 21:00






$begingroup$
You can read up on Triangle Inequality if you want... It seems that sometimes we refer to this case as a degenerate triangle which I think of (and seems to be the common parlance) as more of a line segment than a triangle.
$endgroup$
– Mason
Dec 18 '18 at 21:00












2 Answers
2






active

oldest

votes


















3












$begingroup$


I am trying to create a program for a school project where I need to plot points of a triangle given all 3 side lengths (a=10, b=20, c=30).




By the triangle inequality $a + b > c$. In this case you have $a + b =c$. So this will be a straight line where $C$ is in a line in between $A$ and $B$.




I tried the solution from the other topic




WHAT other topic?




and it didn't work since the result produced was C(20,0)




That is correct. $A = (0,0)$ and $B = (30, 0)$ and $C = (20,0)$ then $a = BC = sqrt{(30-20)^2 - (0-0)^2} = sqrt{(10)^2} = 10$ and $b = AC = sqrt{(0-20)^2 - (0-0)^2} = sqrt{(-20)^2} = 20$ and $c = AB = sqrt{(0-30)^2 - (0-0)^2} = sqrt{ (-30)^2} = 30$.




and that cant be right since one of the sides is already placed on the axis and its not a right triangle.




Who said it was a right triangle?



$a^2 + b^2 = 10^2 + 20^2 = 100 + 400 = 500$ but $c^2 = 30^2 = 900$ and $500 ne 900$. It isn't a right triangle.




Is there a formula I can plug into my program that will produce point C, given that I place A and B on x or y axis and will work with any triangle?




So if $A= (0,0)$ and $B= (c,0)$ then $C = (x,y)$ where



$b^2 = AC^2 = x^2 +y^2$



$a^2 = BC^2 = (x-c)^2 + y^2$



So $a^2 - b^2 = (x-c)^2 - x^2$ or



$a^2 - b^2 = x^2 - 2cx + c^2 - y^2 = -2cx + c^2$ or



$x = frac {c^2 + b^2 -a^2}{2c}$



And so $x^2 +y^2 = b^2$ so



$y = sqrt{ b^2 - x^2}$





Plugging in $a = 10; b=20; c= 30$ we get



$x =frac {c^2 + b^2 -a^2}{2c}= frac {30^2 + 20^2 -10^2}{2*30}= frac {900+ 400 - 100}{60} = frac {1200}{60} = 20$



And $x =sqrt{ b^2 - x^2}= sqrt {20^2 - 20^2} = 0$.



So $C = (20, 0)$





For a more proper triangle sa $a = 20; b= 15; c=25$ (an actual right triangle.



You get $A=(0,0)$ and $B = (25,0)$ and $C = (x,y)$ where



$x = frac {c^2 + b^2 -a^2}{2c}= frac {25^2 + 15^2-20^2}{50}= 9 $



and
$y = sqrt{ b^2 - x^2}= sqrt{15^2 - 9^2} = 12$



So $C = (9,12)$.



======



Now for an example where that fails: Say $a = 20; b=30; c = 60$. That's impossible because $a+b < c$. No such triangle exists.



If $A=(0,0)$ and $B=(60,0)$ then $C = (x,y)$ with



$x = frac {c^2 + b^2 -a^2}{2c}= frac {60^2 + 30^2-20^2}{60}= 10sqrt{41}$



and
$y = sqrt{ b^2 - x^2}= sqrt{20^2 - (10sqrt{41}^2} = sqrt{400-410} = sqrt{-10}$



So $C = (10sqrt{41},sqrt{-10})$ is not possible.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Thank you. I guess it was some kind of trick question "In main(), create one instance each of the following: a Circle with a radius of 23, a Square with sides 25, and a Triangle with sides 10, 20, 30. Define all of them so that the origin (0,0) is somewhere within each object. Display the information from each object." I know that it's not a right triangle, I said that its not.
    $endgroup$
    – Stand Studios
    Dec 19 '18 at 14:27





















1












$begingroup$

Given sides a,b,and c, use the law of cosines to calculate the angle $theta$ between a and b. then (for example), plot b as horizontal, and plot a as a directional vector, with angle $theta.$






share|cite|improve this answer









$endgroup$













    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "69"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3045677%2fhow-to-plot-a-triangle-given-three-side-lengths%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3












    $begingroup$


    I am trying to create a program for a school project where I need to plot points of a triangle given all 3 side lengths (a=10, b=20, c=30).




    By the triangle inequality $a + b > c$. In this case you have $a + b =c$. So this will be a straight line where $C$ is in a line in between $A$ and $B$.




    I tried the solution from the other topic




    WHAT other topic?




    and it didn't work since the result produced was C(20,0)




    That is correct. $A = (0,0)$ and $B = (30, 0)$ and $C = (20,0)$ then $a = BC = sqrt{(30-20)^2 - (0-0)^2} = sqrt{(10)^2} = 10$ and $b = AC = sqrt{(0-20)^2 - (0-0)^2} = sqrt{(-20)^2} = 20$ and $c = AB = sqrt{(0-30)^2 - (0-0)^2} = sqrt{ (-30)^2} = 30$.




    and that cant be right since one of the sides is already placed on the axis and its not a right triangle.




    Who said it was a right triangle?



    $a^2 + b^2 = 10^2 + 20^2 = 100 + 400 = 500$ but $c^2 = 30^2 = 900$ and $500 ne 900$. It isn't a right triangle.




    Is there a formula I can plug into my program that will produce point C, given that I place A and B on x or y axis and will work with any triangle?




    So if $A= (0,0)$ and $B= (c,0)$ then $C = (x,y)$ where



    $b^2 = AC^2 = x^2 +y^2$



    $a^2 = BC^2 = (x-c)^2 + y^2$



    So $a^2 - b^2 = (x-c)^2 - x^2$ or



    $a^2 - b^2 = x^2 - 2cx + c^2 - y^2 = -2cx + c^2$ or



    $x = frac {c^2 + b^2 -a^2}{2c}$



    And so $x^2 +y^2 = b^2$ so



    $y = sqrt{ b^2 - x^2}$





    Plugging in $a = 10; b=20; c= 30$ we get



    $x =frac {c^2 + b^2 -a^2}{2c}= frac {30^2 + 20^2 -10^2}{2*30}= frac {900+ 400 - 100}{60} = frac {1200}{60} = 20$



    And $x =sqrt{ b^2 - x^2}= sqrt {20^2 - 20^2} = 0$.



    So $C = (20, 0)$





    For a more proper triangle sa $a = 20; b= 15; c=25$ (an actual right triangle.



    You get $A=(0,0)$ and $B = (25,0)$ and $C = (x,y)$ where



    $x = frac {c^2 + b^2 -a^2}{2c}= frac {25^2 + 15^2-20^2}{50}= 9 $



    and
    $y = sqrt{ b^2 - x^2}= sqrt{15^2 - 9^2} = 12$



    So $C = (9,12)$.



    ======



    Now for an example where that fails: Say $a = 20; b=30; c = 60$. That's impossible because $a+b < c$. No such triangle exists.



    If $A=(0,0)$ and $B=(60,0)$ then $C = (x,y)$ with



    $x = frac {c^2 + b^2 -a^2}{2c}= frac {60^2 + 30^2-20^2}{60}= 10sqrt{41}$



    and
    $y = sqrt{ b^2 - x^2}= sqrt{20^2 - (10sqrt{41}^2} = sqrt{400-410} = sqrt{-10}$



    So $C = (10sqrt{41},sqrt{-10})$ is not possible.






    share|cite|improve this answer











    $endgroup$













    • $begingroup$
      Thank you. I guess it was some kind of trick question "In main(), create one instance each of the following: a Circle with a radius of 23, a Square with sides 25, and a Triangle with sides 10, 20, 30. Define all of them so that the origin (0,0) is somewhere within each object. Display the information from each object." I know that it's not a right triangle, I said that its not.
      $endgroup$
      – Stand Studios
      Dec 19 '18 at 14:27


















    3












    $begingroup$


    I am trying to create a program for a school project where I need to plot points of a triangle given all 3 side lengths (a=10, b=20, c=30).




    By the triangle inequality $a + b > c$. In this case you have $a + b =c$. So this will be a straight line where $C$ is in a line in between $A$ and $B$.




    I tried the solution from the other topic




    WHAT other topic?




    and it didn't work since the result produced was C(20,0)




    That is correct. $A = (0,0)$ and $B = (30, 0)$ and $C = (20,0)$ then $a = BC = sqrt{(30-20)^2 - (0-0)^2} = sqrt{(10)^2} = 10$ and $b = AC = sqrt{(0-20)^2 - (0-0)^2} = sqrt{(-20)^2} = 20$ and $c = AB = sqrt{(0-30)^2 - (0-0)^2} = sqrt{ (-30)^2} = 30$.




    and that cant be right since one of the sides is already placed on the axis and its not a right triangle.




    Who said it was a right triangle?



    $a^2 + b^2 = 10^2 + 20^2 = 100 + 400 = 500$ but $c^2 = 30^2 = 900$ and $500 ne 900$. It isn't a right triangle.




    Is there a formula I can plug into my program that will produce point C, given that I place A and B on x or y axis and will work with any triangle?




    So if $A= (0,0)$ and $B= (c,0)$ then $C = (x,y)$ where



    $b^2 = AC^2 = x^2 +y^2$



    $a^2 = BC^2 = (x-c)^2 + y^2$



    So $a^2 - b^2 = (x-c)^2 - x^2$ or



    $a^2 - b^2 = x^2 - 2cx + c^2 - y^2 = -2cx + c^2$ or



    $x = frac {c^2 + b^2 -a^2}{2c}$



    And so $x^2 +y^2 = b^2$ so



    $y = sqrt{ b^2 - x^2}$





    Plugging in $a = 10; b=20; c= 30$ we get



    $x =frac {c^2 + b^2 -a^2}{2c}= frac {30^2 + 20^2 -10^2}{2*30}= frac {900+ 400 - 100}{60} = frac {1200}{60} = 20$



    And $x =sqrt{ b^2 - x^2}= sqrt {20^2 - 20^2} = 0$.



    So $C = (20, 0)$





    For a more proper triangle sa $a = 20; b= 15; c=25$ (an actual right triangle.



    You get $A=(0,0)$ and $B = (25,0)$ and $C = (x,y)$ where



    $x = frac {c^2 + b^2 -a^2}{2c}= frac {25^2 + 15^2-20^2}{50}= 9 $



    and
    $y = sqrt{ b^2 - x^2}= sqrt{15^2 - 9^2} = 12$



    So $C = (9,12)$.



    ======



    Now for an example where that fails: Say $a = 20; b=30; c = 60$. That's impossible because $a+b < c$. No such triangle exists.



    If $A=(0,0)$ and $B=(60,0)$ then $C = (x,y)$ with



    $x = frac {c^2 + b^2 -a^2}{2c}= frac {60^2 + 30^2-20^2}{60}= 10sqrt{41}$



    and
    $y = sqrt{ b^2 - x^2}= sqrt{20^2 - (10sqrt{41}^2} = sqrt{400-410} = sqrt{-10}$



    So $C = (10sqrt{41},sqrt{-10})$ is not possible.






    share|cite|improve this answer











    $endgroup$













    • $begingroup$
      Thank you. I guess it was some kind of trick question "In main(), create one instance each of the following: a Circle with a radius of 23, a Square with sides 25, and a Triangle with sides 10, 20, 30. Define all of them so that the origin (0,0) is somewhere within each object. Display the information from each object." I know that it's not a right triangle, I said that its not.
      $endgroup$
      – Stand Studios
      Dec 19 '18 at 14:27
















    3












    3








    3





    $begingroup$


    I am trying to create a program for a school project where I need to plot points of a triangle given all 3 side lengths (a=10, b=20, c=30).




    By the triangle inequality $a + b > c$. In this case you have $a + b =c$. So this will be a straight line where $C$ is in a line in between $A$ and $B$.




    I tried the solution from the other topic




    WHAT other topic?




    and it didn't work since the result produced was C(20,0)




    That is correct. $A = (0,0)$ and $B = (30, 0)$ and $C = (20,0)$ then $a = BC = sqrt{(30-20)^2 - (0-0)^2} = sqrt{(10)^2} = 10$ and $b = AC = sqrt{(0-20)^2 - (0-0)^2} = sqrt{(-20)^2} = 20$ and $c = AB = sqrt{(0-30)^2 - (0-0)^2} = sqrt{ (-30)^2} = 30$.




    and that cant be right since one of the sides is already placed on the axis and its not a right triangle.




    Who said it was a right triangle?



    $a^2 + b^2 = 10^2 + 20^2 = 100 + 400 = 500$ but $c^2 = 30^2 = 900$ and $500 ne 900$. It isn't a right triangle.




    Is there a formula I can plug into my program that will produce point C, given that I place A and B on x or y axis and will work with any triangle?




    So if $A= (0,0)$ and $B= (c,0)$ then $C = (x,y)$ where



    $b^2 = AC^2 = x^2 +y^2$



    $a^2 = BC^2 = (x-c)^2 + y^2$



    So $a^2 - b^2 = (x-c)^2 - x^2$ or



    $a^2 - b^2 = x^2 - 2cx + c^2 - y^2 = -2cx + c^2$ or



    $x = frac {c^2 + b^2 -a^2}{2c}$



    And so $x^2 +y^2 = b^2$ so



    $y = sqrt{ b^2 - x^2}$





    Plugging in $a = 10; b=20; c= 30$ we get



    $x =frac {c^2 + b^2 -a^2}{2c}= frac {30^2 + 20^2 -10^2}{2*30}= frac {900+ 400 - 100}{60} = frac {1200}{60} = 20$



    And $x =sqrt{ b^2 - x^2}= sqrt {20^2 - 20^2} = 0$.



    So $C = (20, 0)$





    For a more proper triangle sa $a = 20; b= 15; c=25$ (an actual right triangle.



    You get $A=(0,0)$ and $B = (25,0)$ and $C = (x,y)$ where



    $x = frac {c^2 + b^2 -a^2}{2c}= frac {25^2 + 15^2-20^2}{50}= 9 $



    and
    $y = sqrt{ b^2 - x^2}= sqrt{15^2 - 9^2} = 12$



    So $C = (9,12)$.



    ======



    Now for an example where that fails: Say $a = 20; b=30; c = 60$. That's impossible because $a+b < c$. No such triangle exists.



    If $A=(0,0)$ and $B=(60,0)$ then $C = (x,y)$ with



    $x = frac {c^2 + b^2 -a^2}{2c}= frac {60^2 + 30^2-20^2}{60}= 10sqrt{41}$



    and
    $y = sqrt{ b^2 - x^2}= sqrt{20^2 - (10sqrt{41}^2} = sqrt{400-410} = sqrt{-10}$



    So $C = (10sqrt{41},sqrt{-10})$ is not possible.






    share|cite|improve this answer











    $endgroup$




    I am trying to create a program for a school project where I need to plot points of a triangle given all 3 side lengths (a=10, b=20, c=30).




    By the triangle inequality $a + b > c$. In this case you have $a + b =c$. So this will be a straight line where $C$ is in a line in between $A$ and $B$.




    I tried the solution from the other topic




    WHAT other topic?




    and it didn't work since the result produced was C(20,0)




    That is correct. $A = (0,0)$ and $B = (30, 0)$ and $C = (20,0)$ then $a = BC = sqrt{(30-20)^2 - (0-0)^2} = sqrt{(10)^2} = 10$ and $b = AC = sqrt{(0-20)^2 - (0-0)^2} = sqrt{(-20)^2} = 20$ and $c = AB = sqrt{(0-30)^2 - (0-0)^2} = sqrt{ (-30)^2} = 30$.




    and that cant be right since one of the sides is already placed on the axis and its not a right triangle.




    Who said it was a right triangle?



    $a^2 + b^2 = 10^2 + 20^2 = 100 + 400 = 500$ but $c^2 = 30^2 = 900$ and $500 ne 900$. It isn't a right triangle.




    Is there a formula I can plug into my program that will produce point C, given that I place A and B on x or y axis and will work with any triangle?




    So if $A= (0,0)$ and $B= (c,0)$ then $C = (x,y)$ where



    $b^2 = AC^2 = x^2 +y^2$



    $a^2 = BC^2 = (x-c)^2 + y^2$



    So $a^2 - b^2 = (x-c)^2 - x^2$ or



    $a^2 - b^2 = x^2 - 2cx + c^2 - y^2 = -2cx + c^2$ or



    $x = frac {c^2 + b^2 -a^2}{2c}$



    And so $x^2 +y^2 = b^2$ so



    $y = sqrt{ b^2 - x^2}$





    Plugging in $a = 10; b=20; c= 30$ we get



    $x =frac {c^2 + b^2 -a^2}{2c}= frac {30^2 + 20^2 -10^2}{2*30}= frac {900+ 400 - 100}{60} = frac {1200}{60} = 20$



    And $x =sqrt{ b^2 - x^2}= sqrt {20^2 - 20^2} = 0$.



    So $C = (20, 0)$





    For a more proper triangle sa $a = 20; b= 15; c=25$ (an actual right triangle.



    You get $A=(0,0)$ and $B = (25,0)$ and $C = (x,y)$ where



    $x = frac {c^2 + b^2 -a^2}{2c}= frac {25^2 + 15^2-20^2}{50}= 9 $



    and
    $y = sqrt{ b^2 - x^2}= sqrt{15^2 - 9^2} = 12$



    So $C = (9,12)$.



    ======



    Now for an example where that fails: Say $a = 20; b=30; c = 60$. That's impossible because $a+b < c$. No such triangle exists.



    If $A=(0,0)$ and $B=(60,0)$ then $C = (x,y)$ with



    $x = frac {c^2 + b^2 -a^2}{2c}= frac {60^2 + 30^2-20^2}{60}= 10sqrt{41}$



    and
    $y = sqrt{ b^2 - x^2}= sqrt{20^2 - (10sqrt{41}^2} = sqrt{400-410} = sqrt{-10}$



    So $C = (10sqrt{41},sqrt{-10})$ is not possible.







    share|cite|improve this answer














    share|cite|improve this answer



    share|cite|improve this answer








    edited Dec 18 '18 at 23:27

























    answered Dec 18 '18 at 21:18









    fleabloodfleablood

    69.4k22685




    69.4k22685












    • $begingroup$
      Thank you. I guess it was some kind of trick question "In main(), create one instance each of the following: a Circle with a radius of 23, a Square with sides 25, and a Triangle with sides 10, 20, 30. Define all of them so that the origin (0,0) is somewhere within each object. Display the information from each object." I know that it's not a right triangle, I said that its not.
      $endgroup$
      – Stand Studios
      Dec 19 '18 at 14:27




















    • $begingroup$
      Thank you. I guess it was some kind of trick question "In main(), create one instance each of the following: a Circle with a radius of 23, a Square with sides 25, and a Triangle with sides 10, 20, 30. Define all of them so that the origin (0,0) is somewhere within each object. Display the information from each object." I know that it's not a right triangle, I said that its not.
      $endgroup$
      – Stand Studios
      Dec 19 '18 at 14:27


















    $begingroup$
    Thank you. I guess it was some kind of trick question "In main(), create one instance each of the following: a Circle with a radius of 23, a Square with sides 25, and a Triangle with sides 10, 20, 30. Define all of them so that the origin (0,0) is somewhere within each object. Display the information from each object." I know that it's not a right triangle, I said that its not.
    $endgroup$
    – Stand Studios
    Dec 19 '18 at 14:27






    $begingroup$
    Thank you. I guess it was some kind of trick question "In main(), create one instance each of the following: a Circle with a radius of 23, a Square with sides 25, and a Triangle with sides 10, 20, 30. Define all of them so that the origin (0,0) is somewhere within each object. Display the information from each object." I know that it's not a right triangle, I said that its not.
    $endgroup$
    – Stand Studios
    Dec 19 '18 at 14:27













    1












    $begingroup$

    Given sides a,b,and c, use the law of cosines to calculate the angle $theta$ between a and b. then (for example), plot b as horizontal, and plot a as a directional vector, with angle $theta.$






    share|cite|improve this answer









    $endgroup$


















      1












      $begingroup$

      Given sides a,b,and c, use the law of cosines to calculate the angle $theta$ between a and b. then (for example), plot b as horizontal, and plot a as a directional vector, with angle $theta.$






      share|cite|improve this answer









      $endgroup$
















        1












        1








        1





        $begingroup$

        Given sides a,b,and c, use the law of cosines to calculate the angle $theta$ between a and b. then (for example), plot b as horizontal, and plot a as a directional vector, with angle $theta.$






        share|cite|improve this answer









        $endgroup$



        Given sides a,b,and c, use the law of cosines to calculate the angle $theta$ between a and b. then (for example), plot b as horizontal, and plot a as a directional vector, with angle $theta.$







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Dec 18 '18 at 23:07









        user2661923user2661923

        510112




        510112






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3045677%2fhow-to-plot-a-triangle-given-three-side-lengths%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Bressuire

            Cabo Verde

            Gyllenstierna