How to find heading angle to an object whose $x,y$ coordinates are known?












0












$begingroup$


Scenario: I have a map with a marked location on it. I know my $x,y$ coordinates on the map (top left corner is $0,0$), my distance from that marked location, my heading angle relative to true north ($0^circ$ is north, $90^circ$ is east, $180^circ rm S$, and $270^circ rm W$), and my bearing (bearing here meaning the angle I have to turn in order to be facing the marked location.



Imagine a half-circle sonar with $0^circ$ on left, a ping of $35^circ$ means I turn that angle to face the ping). I also know the $x,y$ coordinates of a point on the map I'm trying to get to, but I need to find out my distance to that point, and the heading I should be at to go straight towards that point.



Given




  • 3 points: my location, marked location, location I'm trying to get to.

  • distance from my location to marked location

  • My heading and the bearing from my location to the marked location


Trying to find




  • distance from my location to location I'm trying to get to

  • heading I should have to reach the location I'm trying to get to


In the poorly drawn image below: $color{red}{text{Red dot}}$ is my location. $text{Black dot}$ is marked known location. $text{Black line}$ is distance between red and black dot. Small Orange line is my heading ($45^circ$ let's say). My bearing to the $text{black dot}$ is $35^circ$. I need to find the distance from the $color{red}{text{red dot}}$ to the $color{green}{text{green dot}}$, and the angle from the $color{red}{text{Red dot}}$'s heading (orange line) to the $color{green}{text{green dot}}$ (dotted line).



enter image description here



So, finding the distance should just be the normal distance formula right? However, the angle part is confusing me. I've been banging my head against the desk trying to figure this out. Would I have to make a right triangle using the $color{red}{text{red dot}}$, $color{green}{text{green dot}}$, and East ($90^circ$)?










share|cite|improve this question











$endgroup$












  • $begingroup$
    Would best bet be to make a right triangle out of one of the directional angles i.e. East, find the angle using inverse of tangent with the opposite and adjacent sides of the triangle (known from x,y coordinates of each, could use cos/sin too), then subtract that from the heading ?
    $endgroup$
    – pfinferno
    Jan 14 '15 at 19:19
















0












$begingroup$


Scenario: I have a map with a marked location on it. I know my $x,y$ coordinates on the map (top left corner is $0,0$), my distance from that marked location, my heading angle relative to true north ($0^circ$ is north, $90^circ$ is east, $180^circ rm S$, and $270^circ rm W$), and my bearing (bearing here meaning the angle I have to turn in order to be facing the marked location.



Imagine a half-circle sonar with $0^circ$ on left, a ping of $35^circ$ means I turn that angle to face the ping). I also know the $x,y$ coordinates of a point on the map I'm trying to get to, but I need to find out my distance to that point, and the heading I should be at to go straight towards that point.



Given




  • 3 points: my location, marked location, location I'm trying to get to.

  • distance from my location to marked location

  • My heading and the bearing from my location to the marked location


Trying to find




  • distance from my location to location I'm trying to get to

  • heading I should have to reach the location I'm trying to get to


In the poorly drawn image below: $color{red}{text{Red dot}}$ is my location. $text{Black dot}$ is marked known location. $text{Black line}$ is distance between red and black dot. Small Orange line is my heading ($45^circ$ let's say). My bearing to the $text{black dot}$ is $35^circ$. I need to find the distance from the $color{red}{text{red dot}}$ to the $color{green}{text{green dot}}$, and the angle from the $color{red}{text{Red dot}}$'s heading (orange line) to the $color{green}{text{green dot}}$ (dotted line).



enter image description here



So, finding the distance should just be the normal distance formula right? However, the angle part is confusing me. I've been banging my head against the desk trying to figure this out. Would I have to make a right triangle using the $color{red}{text{red dot}}$, $color{green}{text{green dot}}$, and East ($90^circ$)?










share|cite|improve this question











$endgroup$












  • $begingroup$
    Would best bet be to make a right triangle out of one of the directional angles i.e. East, find the angle using inverse of tangent with the opposite and adjacent sides of the triangle (known from x,y coordinates of each, could use cos/sin too), then subtract that from the heading ?
    $endgroup$
    – pfinferno
    Jan 14 '15 at 19:19














0












0








0





$begingroup$


Scenario: I have a map with a marked location on it. I know my $x,y$ coordinates on the map (top left corner is $0,0$), my distance from that marked location, my heading angle relative to true north ($0^circ$ is north, $90^circ$ is east, $180^circ rm S$, and $270^circ rm W$), and my bearing (bearing here meaning the angle I have to turn in order to be facing the marked location.



Imagine a half-circle sonar with $0^circ$ on left, a ping of $35^circ$ means I turn that angle to face the ping). I also know the $x,y$ coordinates of a point on the map I'm trying to get to, but I need to find out my distance to that point, and the heading I should be at to go straight towards that point.



Given




  • 3 points: my location, marked location, location I'm trying to get to.

  • distance from my location to marked location

  • My heading and the bearing from my location to the marked location


Trying to find




  • distance from my location to location I'm trying to get to

  • heading I should have to reach the location I'm trying to get to


In the poorly drawn image below: $color{red}{text{Red dot}}$ is my location. $text{Black dot}$ is marked known location. $text{Black line}$ is distance between red and black dot. Small Orange line is my heading ($45^circ$ let's say). My bearing to the $text{black dot}$ is $35^circ$. I need to find the distance from the $color{red}{text{red dot}}$ to the $color{green}{text{green dot}}$, and the angle from the $color{red}{text{Red dot}}$'s heading (orange line) to the $color{green}{text{green dot}}$ (dotted line).



enter image description here



So, finding the distance should just be the normal distance formula right? However, the angle part is confusing me. I've been banging my head against the desk trying to figure this out. Would I have to make a right triangle using the $color{red}{text{red dot}}$, $color{green}{text{green dot}}$, and East ($90^circ$)?










share|cite|improve this question











$endgroup$




Scenario: I have a map with a marked location on it. I know my $x,y$ coordinates on the map (top left corner is $0,0$), my distance from that marked location, my heading angle relative to true north ($0^circ$ is north, $90^circ$ is east, $180^circ rm S$, and $270^circ rm W$), and my bearing (bearing here meaning the angle I have to turn in order to be facing the marked location.



Imagine a half-circle sonar with $0^circ$ on left, a ping of $35^circ$ means I turn that angle to face the ping). I also know the $x,y$ coordinates of a point on the map I'm trying to get to, but I need to find out my distance to that point, and the heading I should be at to go straight towards that point.



Given




  • 3 points: my location, marked location, location I'm trying to get to.

  • distance from my location to marked location

  • My heading and the bearing from my location to the marked location


Trying to find




  • distance from my location to location I'm trying to get to

  • heading I should have to reach the location I'm trying to get to


In the poorly drawn image below: $color{red}{text{Red dot}}$ is my location. $text{Black dot}$ is marked known location. $text{Black line}$ is distance between red and black dot. Small Orange line is my heading ($45^circ$ let's say). My bearing to the $text{black dot}$ is $35^circ$. I need to find the distance from the $color{red}{text{red dot}}$ to the $color{green}{text{green dot}}$, and the angle from the $color{red}{text{Red dot}}$'s heading (orange line) to the $color{green}{text{green dot}}$ (dotted line).



enter image description here



So, finding the distance should just be the normal distance formula right? However, the angle part is confusing me. I've been banging my head against the desk trying to figure this out. Would I have to make a right triangle using the $color{red}{text{red dot}}$, $color{green}{text{green dot}}$, and East ($90^circ$)?







trigonometry triangle






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 2 '18 at 7:34









Tianlalu

3,08621038




3,08621038










asked Jan 14 '15 at 19:13









pfinfernopfinferno

209313




209313












  • $begingroup$
    Would best bet be to make a right triangle out of one of the directional angles i.e. East, find the angle using inverse of tangent with the opposite and adjacent sides of the triangle (known from x,y coordinates of each, could use cos/sin too), then subtract that from the heading ?
    $endgroup$
    – pfinferno
    Jan 14 '15 at 19:19


















  • $begingroup$
    Would best bet be to make a right triangle out of one of the directional angles i.e. East, find the angle using inverse of tangent with the opposite and adjacent sides of the triangle (known from x,y coordinates of each, could use cos/sin too), then subtract that from the heading ?
    $endgroup$
    – pfinferno
    Jan 14 '15 at 19:19
















$begingroup$
Would best bet be to make a right triangle out of one of the directional angles i.e. East, find the angle using inverse of tangent with the opposite and adjacent sides of the triangle (known from x,y coordinates of each, could use cos/sin too), then subtract that from the heading ?
$endgroup$
– pfinferno
Jan 14 '15 at 19:19




$begingroup$
Would best bet be to make a right triangle out of one of the directional angles i.e. East, find the angle using inverse of tangent with the opposite and adjacent sides of the triangle (known from x,y coordinates of each, could use cos/sin too), then subtract that from the heading ?
$endgroup$
– pfinferno
Jan 14 '15 at 19:19










1 Answer
1






active

oldest

votes


















0












$begingroup$

Let your position be $x_0, y_0$ and your heading angle be $alpha$ where due north has $alpha = 0$.



Then a unit vector in your heading direction (the orange line) will be $sin alpha hat{x} + cos alpha hat{y}$. And a unit vector toward your green dot at $(x,y) = (x_0 + Delta x,y_0 + Delta y)$ will be $frac{1}{R} (Delta x hat{x} + Delta y hat{y})$ where $R$ is the distance $R = sqrt { (Delta x)^2 + (Delta y)^2}$.



Then the cosine of the bearing angle $beta$ between the orange heading line and the dotted direction line is given by the dot product of those two unit vectors.
$$
cos beta =frac{1}{R} left( Delta x sin alpha + Delta y cos alpharight) \
beta =cos^{-1} frac{Delta x sin alpha + Delta y cos alpha}{R}
$$






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%2f1104418%2fhow-to-find-heading-angle-to-an-object-whose-x-y-coordinates-are-known%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0












    $begingroup$

    Let your position be $x_0, y_0$ and your heading angle be $alpha$ where due north has $alpha = 0$.



    Then a unit vector in your heading direction (the orange line) will be $sin alpha hat{x} + cos alpha hat{y}$. And a unit vector toward your green dot at $(x,y) = (x_0 + Delta x,y_0 + Delta y)$ will be $frac{1}{R} (Delta x hat{x} + Delta y hat{y})$ where $R$ is the distance $R = sqrt { (Delta x)^2 + (Delta y)^2}$.



    Then the cosine of the bearing angle $beta$ between the orange heading line and the dotted direction line is given by the dot product of those two unit vectors.
    $$
    cos beta =frac{1}{R} left( Delta x sin alpha + Delta y cos alpharight) \
    beta =cos^{-1} frac{Delta x sin alpha + Delta y cos alpha}{R}
    $$






    share|cite|improve this answer









    $endgroup$


















      0












      $begingroup$

      Let your position be $x_0, y_0$ and your heading angle be $alpha$ where due north has $alpha = 0$.



      Then a unit vector in your heading direction (the orange line) will be $sin alpha hat{x} + cos alpha hat{y}$. And a unit vector toward your green dot at $(x,y) = (x_0 + Delta x,y_0 + Delta y)$ will be $frac{1}{R} (Delta x hat{x} + Delta y hat{y})$ where $R$ is the distance $R = sqrt { (Delta x)^2 + (Delta y)^2}$.



      Then the cosine of the bearing angle $beta$ between the orange heading line and the dotted direction line is given by the dot product of those two unit vectors.
      $$
      cos beta =frac{1}{R} left( Delta x sin alpha + Delta y cos alpharight) \
      beta =cos^{-1} frac{Delta x sin alpha + Delta y cos alpha}{R}
      $$






      share|cite|improve this answer









      $endgroup$
















        0












        0








        0





        $begingroup$

        Let your position be $x_0, y_0$ and your heading angle be $alpha$ where due north has $alpha = 0$.



        Then a unit vector in your heading direction (the orange line) will be $sin alpha hat{x} + cos alpha hat{y}$. And a unit vector toward your green dot at $(x,y) = (x_0 + Delta x,y_0 + Delta y)$ will be $frac{1}{R} (Delta x hat{x} + Delta y hat{y})$ where $R$ is the distance $R = sqrt { (Delta x)^2 + (Delta y)^2}$.



        Then the cosine of the bearing angle $beta$ between the orange heading line and the dotted direction line is given by the dot product of those two unit vectors.
        $$
        cos beta =frac{1}{R} left( Delta x sin alpha + Delta y cos alpharight) \
        beta =cos^{-1} frac{Delta x sin alpha + Delta y cos alpha}{R}
        $$






        share|cite|improve this answer









        $endgroup$



        Let your position be $x_0, y_0$ and your heading angle be $alpha$ where due north has $alpha = 0$.



        Then a unit vector in your heading direction (the orange line) will be $sin alpha hat{x} + cos alpha hat{y}$. And a unit vector toward your green dot at $(x,y) = (x_0 + Delta x,y_0 + Delta y)$ will be $frac{1}{R} (Delta x hat{x} + Delta y hat{y})$ where $R$ is the distance $R = sqrt { (Delta x)^2 + (Delta y)^2}$.



        Then the cosine of the bearing angle $beta$ between the orange heading line and the dotted direction line is given by the dot product of those two unit vectors.
        $$
        cos beta =frac{1}{R} left( Delta x sin alpha + Delta y cos alpharight) \
        beta =cos^{-1} frac{Delta x sin alpha + Delta y cos alpha}{R}
        $$







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Jan 14 '15 at 19:30









        Mark FischlerMark Fischler

        32.4k12251




        32.4k12251






























            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%2f1104418%2fhow-to-find-heading-angle-to-an-object-whose-x-y-coordinates-are-known%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

            Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

            ComboBox Display Member on multiple fields

            Is it possible to collect Nectar points via Trainline?