Finding the interior tangent circles of a given radius of a concave polygon












0












$begingroup$


I am trying to write an algorithm for calculating toolpath's for CNC machines and in doing so I need to find a way of determining all the circles of a given radius whose centers lie on the bisector of each internal angle and be also tangent to both sides that form the angle.



We have:
-a polygon of n sides which is not self-intersecting and whose internal angles may or may not be greater than pi radians.
-n vertices which are given in a clockwise direction and n internal angles
-the radius of the circle



What I did is
- calculate the n clockwise vectors ( from V1 to V2...... Vn-1 to Vn) and the n anticlockwise vectors ( from V2 to V1......Vn to Vn-1)
- calculate the n angles by taking the arccosine of the scalar product of the clockwise vector with it's previous anticlockwise vector all divided by the product of the length of the adjacent sides



Now since the circle is tangent to both sides the distance from the center of the circle to each side is equal to the radius. So this means that the distance from the vertex to the center of the circle is equal to the sine of half the internal angle divided by the radius.



To calculate the direction, I have calculated the clockwise and anticlockwise vectors of magnitude 1. By adding the adjacent vectors of magnitude 1 I have obtained the bisector direction and I have divided the resulting vector by twice the cosine of half the internal angle to ensure that it always has a magnitude of one. By multiplying this vector with the distance from the the vector, we get the change in x and change in y and so can we find the center of the circle.



The issue is that this way of finding the internal angle doesn't works when the angle is greater than pi radians, and so it places the circle outside our given polygon. What I am trying to find is a modification of this formula so that when the angle is greater than pi radians, the circle is placed tangent to the internal corner, on the bisector of the angle. Thanks!










share|cite|improve this question









$endgroup$












  • $begingroup$
    Your question is not clear, here's a couple of issues. 1) A generic polygon doesn't have, in general, an incircle; are you dealing with particular polygons? 2) A polygon with an internal angle greater than 180° is concave, and concave polygons don't have an incircle. You should make clear what exactly you are trying to do.
    $endgroup$
    – Aretino
    Dec 31 '18 at 10:56


















0












$begingroup$


I am trying to write an algorithm for calculating toolpath's for CNC machines and in doing so I need to find a way of determining all the circles of a given radius whose centers lie on the bisector of each internal angle and be also tangent to both sides that form the angle.



We have:
-a polygon of n sides which is not self-intersecting and whose internal angles may or may not be greater than pi radians.
-n vertices which are given in a clockwise direction and n internal angles
-the radius of the circle



What I did is
- calculate the n clockwise vectors ( from V1 to V2...... Vn-1 to Vn) and the n anticlockwise vectors ( from V2 to V1......Vn to Vn-1)
- calculate the n angles by taking the arccosine of the scalar product of the clockwise vector with it's previous anticlockwise vector all divided by the product of the length of the adjacent sides



Now since the circle is tangent to both sides the distance from the center of the circle to each side is equal to the radius. So this means that the distance from the vertex to the center of the circle is equal to the sine of half the internal angle divided by the radius.



To calculate the direction, I have calculated the clockwise and anticlockwise vectors of magnitude 1. By adding the adjacent vectors of magnitude 1 I have obtained the bisector direction and I have divided the resulting vector by twice the cosine of half the internal angle to ensure that it always has a magnitude of one. By multiplying this vector with the distance from the the vector, we get the change in x and change in y and so can we find the center of the circle.



The issue is that this way of finding the internal angle doesn't works when the angle is greater than pi radians, and so it places the circle outside our given polygon. What I am trying to find is a modification of this formula so that when the angle is greater than pi radians, the circle is placed tangent to the internal corner, on the bisector of the angle. Thanks!










share|cite|improve this question









$endgroup$












  • $begingroup$
    Your question is not clear, here's a couple of issues. 1) A generic polygon doesn't have, in general, an incircle; are you dealing with particular polygons? 2) A polygon with an internal angle greater than 180° is concave, and concave polygons don't have an incircle. You should make clear what exactly you are trying to do.
    $endgroup$
    – Aretino
    Dec 31 '18 at 10:56
















0












0








0





$begingroup$


I am trying to write an algorithm for calculating toolpath's for CNC machines and in doing so I need to find a way of determining all the circles of a given radius whose centers lie on the bisector of each internal angle and be also tangent to both sides that form the angle.



We have:
-a polygon of n sides which is not self-intersecting and whose internal angles may or may not be greater than pi radians.
-n vertices which are given in a clockwise direction and n internal angles
-the radius of the circle



What I did is
- calculate the n clockwise vectors ( from V1 to V2...... Vn-1 to Vn) and the n anticlockwise vectors ( from V2 to V1......Vn to Vn-1)
- calculate the n angles by taking the arccosine of the scalar product of the clockwise vector with it's previous anticlockwise vector all divided by the product of the length of the adjacent sides



Now since the circle is tangent to both sides the distance from the center of the circle to each side is equal to the radius. So this means that the distance from the vertex to the center of the circle is equal to the sine of half the internal angle divided by the radius.



To calculate the direction, I have calculated the clockwise and anticlockwise vectors of magnitude 1. By adding the adjacent vectors of magnitude 1 I have obtained the bisector direction and I have divided the resulting vector by twice the cosine of half the internal angle to ensure that it always has a magnitude of one. By multiplying this vector with the distance from the the vector, we get the change in x and change in y and so can we find the center of the circle.



The issue is that this way of finding the internal angle doesn't works when the angle is greater than pi radians, and so it places the circle outside our given polygon. What I am trying to find is a modification of this formula so that when the angle is greater than pi radians, the circle is placed tangent to the internal corner, on the bisector of the angle. Thanks!










share|cite|improve this question









$endgroup$




I am trying to write an algorithm for calculating toolpath's for CNC machines and in doing so I need to find a way of determining all the circles of a given radius whose centers lie on the bisector of each internal angle and be also tangent to both sides that form the angle.



We have:
-a polygon of n sides which is not self-intersecting and whose internal angles may or may not be greater than pi radians.
-n vertices which are given in a clockwise direction and n internal angles
-the radius of the circle



What I did is
- calculate the n clockwise vectors ( from V1 to V2...... Vn-1 to Vn) and the n anticlockwise vectors ( from V2 to V1......Vn to Vn-1)
- calculate the n angles by taking the arccosine of the scalar product of the clockwise vector with it's previous anticlockwise vector all divided by the product of the length of the adjacent sides



Now since the circle is tangent to both sides the distance from the center of the circle to each side is equal to the radius. So this means that the distance from the vertex to the center of the circle is equal to the sine of half the internal angle divided by the radius.



To calculate the direction, I have calculated the clockwise and anticlockwise vectors of magnitude 1. By adding the adjacent vectors of magnitude 1 I have obtained the bisector direction and I have divided the resulting vector by twice the cosine of half the internal angle to ensure that it always has a magnitude of one. By multiplying this vector with the distance from the the vector, we get the change in x and change in y and so can we find the center of the circle.



The issue is that this way of finding the internal angle doesn't works when the angle is greater than pi radians, and so it places the circle outside our given polygon. What I am trying to find is a modification of this formula so that when the angle is greater than pi radians, the circle is placed tangent to the internal corner, on the bisector of the angle. Thanks!







algorithms analytic-geometry






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Dec 22 '18 at 10:38









vldsvlds

213




213












  • $begingroup$
    Your question is not clear, here's a couple of issues. 1) A generic polygon doesn't have, in general, an incircle; are you dealing with particular polygons? 2) A polygon with an internal angle greater than 180° is concave, and concave polygons don't have an incircle. You should make clear what exactly you are trying to do.
    $endgroup$
    – Aretino
    Dec 31 '18 at 10:56




















  • $begingroup$
    Your question is not clear, here's a couple of issues. 1) A generic polygon doesn't have, in general, an incircle; are you dealing with particular polygons? 2) A polygon with an internal angle greater than 180° is concave, and concave polygons don't have an incircle. You should make clear what exactly you are trying to do.
    $endgroup$
    – Aretino
    Dec 31 '18 at 10:56


















$begingroup$
Your question is not clear, here's a couple of issues. 1) A generic polygon doesn't have, in general, an incircle; are you dealing with particular polygons? 2) A polygon with an internal angle greater than 180° is concave, and concave polygons don't have an incircle. You should make clear what exactly you are trying to do.
$endgroup$
– Aretino
Dec 31 '18 at 10:56






$begingroup$
Your question is not clear, here's a couple of issues. 1) A generic polygon doesn't have, in general, an incircle; are you dealing with particular polygons? 2) A polygon with an internal angle greater than 180° is concave, and concave polygons don't have an incircle. You should make clear what exactly you are trying to do.
$endgroup$
– Aretino
Dec 31 '18 at 10:56












0






active

oldest

votes












Your Answer








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%2f3049294%2ffinding-the-interior-tangent-circles-of-a-given-radius-of-a-concave-polygon%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















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%2f3049294%2ffinding-the-interior-tangent-circles-of-a-given-radius-of-a-concave-polygon%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

Plaza Victoria

In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...