Order points on a circle by directional angle

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have several points on a disk with radius of 150. I want to specify an angle and order the points based on the direction of that angle.



I know the coordinates of each point, and I can find the point on the edge of the circle to define the hypotenuse, but I just can't figure out how to get the distance to the perpendicular line "d"



image



After I calculate the distance of each point (light gray line), I can then order the points from least to greatest distance. I hope this makes sense.



click here to see result image







share|cite|improve this question

















  • 1




    According to the image, your points lie on a disc, not on a circle.
    – Arnaud Mortier
    Jul 17 at 23:09






  • 2




    What do you mean by "order the points based on the plane of that angle."? What is the plane of an angle? Is there another plane than the one containing the disc?
    – Arnaud Mortier
    Jul 17 at 23:09











  • It seems like what you're really asking is for the distance between the bold red line through the origin and the parallel line labeled with "$d,$" rather than some method of ordering points in your circular region/disk. You should probably clarify what exactly it is that you want, and make your title match your question.
    – Cameron Buie
    Jul 17 at 23:18






  • 1




    Is this a programming question? If yes, in many languages (e.g. C/C++) there is a function "atan2(y,x)" which returns the angle to the point (x,y), so you could sort points by angle simply by calling this function. There are also some tricks which avoid trigonometry altogether.
    – Zeno Rogue
    Jul 17 at 23:31






  • 1




    Oh, I think I see what you mean now. A simple solution would be to use the inner product. The inner product of $(x_1,y_1)$ and $(x_2,y_2)$ is $x_1x_2+y_1y_2$. If $(x_2,y_2)$ is a vector of length 1, then the inner product is the length of the projection of $(x_1,y_1)$ on $(0,0)-(x_2,y_2)$ (possibly negative if it falls on the other side). So you just have to order them by the inner product with the intersection of the big red line with the circle.
    – Zeno Rogue
    Jul 17 at 23:36















up vote
0
down vote

favorite












I have several points on a disk with radius of 150. I want to specify an angle and order the points based on the direction of that angle.



I know the coordinates of each point, and I can find the point on the edge of the circle to define the hypotenuse, but I just can't figure out how to get the distance to the perpendicular line "d"



image



After I calculate the distance of each point (light gray line), I can then order the points from least to greatest distance. I hope this makes sense.



click here to see result image







share|cite|improve this question

















  • 1




    According to the image, your points lie on a disc, not on a circle.
    – Arnaud Mortier
    Jul 17 at 23:09






  • 2




    What do you mean by "order the points based on the plane of that angle."? What is the plane of an angle? Is there another plane than the one containing the disc?
    – Arnaud Mortier
    Jul 17 at 23:09











  • It seems like what you're really asking is for the distance between the bold red line through the origin and the parallel line labeled with "$d,$" rather than some method of ordering points in your circular region/disk. You should probably clarify what exactly it is that you want, and make your title match your question.
    – Cameron Buie
    Jul 17 at 23:18






  • 1




    Is this a programming question? If yes, in many languages (e.g. C/C++) there is a function "atan2(y,x)" which returns the angle to the point (x,y), so you could sort points by angle simply by calling this function. There are also some tricks which avoid trigonometry altogether.
    – Zeno Rogue
    Jul 17 at 23:31






  • 1




    Oh, I think I see what you mean now. A simple solution would be to use the inner product. The inner product of $(x_1,y_1)$ and $(x_2,y_2)$ is $x_1x_2+y_1y_2$. If $(x_2,y_2)$ is a vector of length 1, then the inner product is the length of the projection of $(x_1,y_1)$ on $(0,0)-(x_2,y_2)$ (possibly negative if it falls on the other side). So you just have to order them by the inner product with the intersection of the big red line with the circle.
    – Zeno Rogue
    Jul 17 at 23:36













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have several points on a disk with radius of 150. I want to specify an angle and order the points based on the direction of that angle.



I know the coordinates of each point, and I can find the point on the edge of the circle to define the hypotenuse, but I just can't figure out how to get the distance to the perpendicular line "d"



image



After I calculate the distance of each point (light gray line), I can then order the points from least to greatest distance. I hope this makes sense.



click here to see result image







share|cite|improve this question













I have several points on a disk with radius of 150. I want to specify an angle and order the points based on the direction of that angle.



I know the coordinates of each point, and I can find the point on the edge of the circle to define the hypotenuse, but I just can't figure out how to get the distance to the perpendicular line "d"



image



After I calculate the distance of each point (light gray line), I can then order the points from least to greatest distance. I hope this makes sense.



click here to see result image









share|cite|improve this question












share|cite|improve this question




share|cite|improve this question








edited Jul 18 at 5:00
























asked Jul 17 at 23:06









user7801

11




11







  • 1




    According to the image, your points lie on a disc, not on a circle.
    – Arnaud Mortier
    Jul 17 at 23:09






  • 2




    What do you mean by "order the points based on the plane of that angle."? What is the plane of an angle? Is there another plane than the one containing the disc?
    – Arnaud Mortier
    Jul 17 at 23:09











  • It seems like what you're really asking is for the distance between the bold red line through the origin and the parallel line labeled with "$d,$" rather than some method of ordering points in your circular region/disk. You should probably clarify what exactly it is that you want, and make your title match your question.
    – Cameron Buie
    Jul 17 at 23:18






  • 1




    Is this a programming question? If yes, in many languages (e.g. C/C++) there is a function "atan2(y,x)" which returns the angle to the point (x,y), so you could sort points by angle simply by calling this function. There are also some tricks which avoid trigonometry altogether.
    – Zeno Rogue
    Jul 17 at 23:31






  • 1




    Oh, I think I see what you mean now. A simple solution would be to use the inner product. The inner product of $(x_1,y_1)$ and $(x_2,y_2)$ is $x_1x_2+y_1y_2$. If $(x_2,y_2)$ is a vector of length 1, then the inner product is the length of the projection of $(x_1,y_1)$ on $(0,0)-(x_2,y_2)$ (possibly negative if it falls on the other side). So you just have to order them by the inner product with the intersection of the big red line with the circle.
    – Zeno Rogue
    Jul 17 at 23:36













  • 1




    According to the image, your points lie on a disc, not on a circle.
    – Arnaud Mortier
    Jul 17 at 23:09






  • 2




    What do you mean by "order the points based on the plane of that angle."? What is the plane of an angle? Is there another plane than the one containing the disc?
    – Arnaud Mortier
    Jul 17 at 23:09











  • It seems like what you're really asking is for the distance between the bold red line through the origin and the parallel line labeled with "$d,$" rather than some method of ordering points in your circular region/disk. You should probably clarify what exactly it is that you want, and make your title match your question.
    – Cameron Buie
    Jul 17 at 23:18






  • 1




    Is this a programming question? If yes, in many languages (e.g. C/C++) there is a function "atan2(y,x)" which returns the angle to the point (x,y), so you could sort points by angle simply by calling this function. There are also some tricks which avoid trigonometry altogether.
    – Zeno Rogue
    Jul 17 at 23:31






  • 1




    Oh, I think I see what you mean now. A simple solution would be to use the inner product. The inner product of $(x_1,y_1)$ and $(x_2,y_2)$ is $x_1x_2+y_1y_2$. If $(x_2,y_2)$ is a vector of length 1, then the inner product is the length of the projection of $(x_1,y_1)$ on $(0,0)-(x_2,y_2)$ (possibly negative if it falls on the other side). So you just have to order them by the inner product with the intersection of the big red line with the circle.
    – Zeno Rogue
    Jul 17 at 23:36








1




1




According to the image, your points lie on a disc, not on a circle.
– Arnaud Mortier
Jul 17 at 23:09




According to the image, your points lie on a disc, not on a circle.
– Arnaud Mortier
Jul 17 at 23:09




2




2




What do you mean by "order the points based on the plane of that angle."? What is the plane of an angle? Is there another plane than the one containing the disc?
– Arnaud Mortier
Jul 17 at 23:09





What do you mean by "order the points based on the plane of that angle."? What is the plane of an angle? Is there another plane than the one containing the disc?
– Arnaud Mortier
Jul 17 at 23:09













It seems like what you're really asking is for the distance between the bold red line through the origin and the parallel line labeled with "$d,$" rather than some method of ordering points in your circular region/disk. You should probably clarify what exactly it is that you want, and make your title match your question.
– Cameron Buie
Jul 17 at 23:18




It seems like what you're really asking is for the distance between the bold red line through the origin and the parallel line labeled with "$d,$" rather than some method of ordering points in your circular region/disk. You should probably clarify what exactly it is that you want, and make your title match your question.
– Cameron Buie
Jul 17 at 23:18




1




1




Is this a programming question? If yes, in many languages (e.g. C/C++) there is a function "atan2(y,x)" which returns the angle to the point (x,y), so you could sort points by angle simply by calling this function. There are also some tricks which avoid trigonometry altogether.
– Zeno Rogue
Jul 17 at 23:31




Is this a programming question? If yes, in many languages (e.g. C/C++) there is a function "atan2(y,x)" which returns the angle to the point (x,y), so you could sort points by angle simply by calling this function. There are also some tricks which avoid trigonometry altogether.
– Zeno Rogue
Jul 17 at 23:31




1




1




Oh, I think I see what you mean now. A simple solution would be to use the inner product. The inner product of $(x_1,y_1)$ and $(x_2,y_2)$ is $x_1x_2+y_1y_2$. If $(x_2,y_2)$ is a vector of length 1, then the inner product is the length of the projection of $(x_1,y_1)$ on $(0,0)-(x_2,y_2)$ (possibly negative if it falls on the other side). So you just have to order them by the inner product with the intersection of the big red line with the circle.
– Zeno Rogue
Jul 17 at 23:36





Oh, I think I see what you mean now. A simple solution would be to use the inner product. The inner product of $(x_1,y_1)$ and $(x_2,y_2)$ is $x_1x_2+y_1y_2$. If $(x_2,y_2)$ is a vector of length 1, then the inner product is the length of the projection of $(x_1,y_1)$ on $(0,0)-(x_2,y_2)$ (possibly negative if it falls on the other side). So you just have to order them by the inner product with the intersection of the big red line with the circle.
– Zeno Rogue
Jul 17 at 23:36











1 Answer
1






active

oldest

votes

















up vote
0
down vote













I figured it out. I rotated the points around the origin(0,0) by (360-given angle). Then the distance to the edge of the disk is the radius (150) minus x. (r-x).






share|cite|improve this answer





















  • Great that you have figured this out. Since you have not understood my suggestion, I would like to remark that this is equivalent to 150 minus the inner product of the chosen point and the appropriate vector. For example, for angle=0 the appropriate vector is (1,0) (and thus you simply return 150-1x-0y = 150-x), for angle=90 the appropriate vector is (0,1) (and thus you return 150-0x-1y=150-y), and so on. In general, the appropriate vector is the vector of length 1 in the direction of the big red line.
    – Zeno Rogue
    Jul 20 at 10:45










  • So basically the inner product is the x coordinate after rotation, and the cross product is the y coordinate.
    – Zeno Rogue
    Jul 20 at 11:28










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',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
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%2f2855012%2forder-points-on-a-circle-by-directional-angle%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













I figured it out. I rotated the points around the origin(0,0) by (360-given angle). Then the distance to the edge of the disk is the radius (150) minus x. (r-x).






share|cite|improve this answer





















  • Great that you have figured this out. Since you have not understood my suggestion, I would like to remark that this is equivalent to 150 minus the inner product of the chosen point and the appropriate vector. For example, for angle=0 the appropriate vector is (1,0) (and thus you simply return 150-1x-0y = 150-x), for angle=90 the appropriate vector is (0,1) (and thus you return 150-0x-1y=150-y), and so on. In general, the appropriate vector is the vector of length 1 in the direction of the big red line.
    – Zeno Rogue
    Jul 20 at 10:45










  • So basically the inner product is the x coordinate after rotation, and the cross product is the y coordinate.
    – Zeno Rogue
    Jul 20 at 11:28














up vote
0
down vote













I figured it out. I rotated the points around the origin(0,0) by (360-given angle). Then the distance to the edge of the disk is the radius (150) minus x. (r-x).






share|cite|improve this answer





















  • Great that you have figured this out. Since you have not understood my suggestion, I would like to remark that this is equivalent to 150 minus the inner product of the chosen point and the appropriate vector. For example, for angle=0 the appropriate vector is (1,0) (and thus you simply return 150-1x-0y = 150-x), for angle=90 the appropriate vector is (0,1) (and thus you return 150-0x-1y=150-y), and so on. In general, the appropriate vector is the vector of length 1 in the direction of the big red line.
    – Zeno Rogue
    Jul 20 at 10:45










  • So basically the inner product is the x coordinate after rotation, and the cross product is the y coordinate.
    – Zeno Rogue
    Jul 20 at 11:28












up vote
0
down vote










up vote
0
down vote









I figured it out. I rotated the points around the origin(0,0) by (360-given angle). Then the distance to the edge of the disk is the radius (150) minus x. (r-x).






share|cite|improve this answer













I figured it out. I rotated the points around the origin(0,0) by (360-given angle). Then the distance to the edge of the disk is the radius (150) minus x. (r-x).







share|cite|improve this answer













share|cite|improve this answer



share|cite|improve this answer











answered Jul 19 at 16:27









user7801

11




11











  • Great that you have figured this out. Since you have not understood my suggestion, I would like to remark that this is equivalent to 150 minus the inner product of the chosen point and the appropriate vector. For example, for angle=0 the appropriate vector is (1,0) (and thus you simply return 150-1x-0y = 150-x), for angle=90 the appropriate vector is (0,1) (and thus you return 150-0x-1y=150-y), and so on. In general, the appropriate vector is the vector of length 1 in the direction of the big red line.
    – Zeno Rogue
    Jul 20 at 10:45










  • So basically the inner product is the x coordinate after rotation, and the cross product is the y coordinate.
    – Zeno Rogue
    Jul 20 at 11:28
















  • Great that you have figured this out. Since you have not understood my suggestion, I would like to remark that this is equivalent to 150 minus the inner product of the chosen point and the appropriate vector. For example, for angle=0 the appropriate vector is (1,0) (and thus you simply return 150-1x-0y = 150-x), for angle=90 the appropriate vector is (0,1) (and thus you return 150-0x-1y=150-y), and so on. In general, the appropriate vector is the vector of length 1 in the direction of the big red line.
    – Zeno Rogue
    Jul 20 at 10:45










  • So basically the inner product is the x coordinate after rotation, and the cross product is the y coordinate.
    – Zeno Rogue
    Jul 20 at 11:28















Great that you have figured this out. Since you have not understood my suggestion, I would like to remark that this is equivalent to 150 minus the inner product of the chosen point and the appropriate vector. For example, for angle=0 the appropriate vector is (1,0) (and thus you simply return 150-1x-0y = 150-x), for angle=90 the appropriate vector is (0,1) (and thus you return 150-0x-1y=150-y), and so on. In general, the appropriate vector is the vector of length 1 in the direction of the big red line.
– Zeno Rogue
Jul 20 at 10:45




Great that you have figured this out. Since you have not understood my suggestion, I would like to remark that this is equivalent to 150 minus the inner product of the chosen point and the appropriate vector. For example, for angle=0 the appropriate vector is (1,0) (and thus you simply return 150-1x-0y = 150-x), for angle=90 the appropriate vector is (0,1) (and thus you return 150-0x-1y=150-y), and so on. In general, the appropriate vector is the vector of length 1 in the direction of the big red line.
– Zeno Rogue
Jul 20 at 10:45












So basically the inner product is the x coordinate after rotation, and the cross product is the y coordinate.
– Zeno Rogue
Jul 20 at 11:28




So basically the inner product is the x coordinate after rotation, and the cross product is the y coordinate.
– Zeno Rogue
Jul 20 at 11:28












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2855012%2forder-points-on-a-circle-by-directional-angle%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What is the equation of a 3D cone with generalised tilt?

Color the edges and diagonals of a regular polygon

Relationship between determinant of matrix and determinant of adjoint?