How to find the intersection of the area of multiple triangles












1












$begingroup$


I have a couple of questions regarding finding the intersection of triangles. I have a system of 16 projectors that all have slightly different color gamuts. The color gamuts are represented by a triangle in the CIE chromaticity space. Here is a picture showing a few color gamuts in chromaticity space.
color gamut



I need to restrict the lager gamut projectors so that all the projectors have the same gamut. I need to find the "greatest common gamut". Which I think boils down to finding the intersection of all 16 gamuts and drawing a triangle between the 3 vertices of the resulting polygon that are closest to the RGB "corners" of chromaticity space.



Is there a closed-form solution to finding the intersection of several triangles? Also I am assuming the intersection operator is associative right? ie ( A int B int C) = ( (A int B) int C ) = ( A int (B int C))? Sorry I don't know how to do the symbols :( Also does anyone know of functions or libraries in Matlab / Octave to find the intersection of polygons? Sorry if I used the wrong terminology anywhere I am not very knowledgeable when it comes to math.










share|cite|improve this question











$endgroup$












  • $begingroup$
    Any ideas at all?
    $endgroup$
    – vanattab
    Dec 29 '12 at 23:11
















1












$begingroup$


I have a couple of questions regarding finding the intersection of triangles. I have a system of 16 projectors that all have slightly different color gamuts. The color gamuts are represented by a triangle in the CIE chromaticity space. Here is a picture showing a few color gamuts in chromaticity space.
color gamut



I need to restrict the lager gamut projectors so that all the projectors have the same gamut. I need to find the "greatest common gamut". Which I think boils down to finding the intersection of all 16 gamuts and drawing a triangle between the 3 vertices of the resulting polygon that are closest to the RGB "corners" of chromaticity space.



Is there a closed-form solution to finding the intersection of several triangles? Also I am assuming the intersection operator is associative right? ie ( A int B int C) = ( (A int B) int C ) = ( A int (B int C))? Sorry I don't know how to do the symbols :( Also does anyone know of functions or libraries in Matlab / Octave to find the intersection of polygons? Sorry if I used the wrong terminology anywhere I am not very knowledgeable when it comes to math.










share|cite|improve this question











$endgroup$












  • $begingroup$
    Any ideas at all?
    $endgroup$
    – vanattab
    Dec 29 '12 at 23:11














1












1








1





$begingroup$


I have a couple of questions regarding finding the intersection of triangles. I have a system of 16 projectors that all have slightly different color gamuts. The color gamuts are represented by a triangle in the CIE chromaticity space. Here is a picture showing a few color gamuts in chromaticity space.
color gamut



I need to restrict the lager gamut projectors so that all the projectors have the same gamut. I need to find the "greatest common gamut". Which I think boils down to finding the intersection of all 16 gamuts and drawing a triangle between the 3 vertices of the resulting polygon that are closest to the RGB "corners" of chromaticity space.



Is there a closed-form solution to finding the intersection of several triangles? Also I am assuming the intersection operator is associative right? ie ( A int B int C) = ( (A int B) int C ) = ( A int (B int C))? Sorry I don't know how to do the symbols :( Also does anyone know of functions or libraries in Matlab / Octave to find the intersection of polygons? Sorry if I used the wrong terminology anywhere I am not very knowledgeable when it comes to math.










share|cite|improve this question











$endgroup$




I have a couple of questions regarding finding the intersection of triangles. I have a system of 16 projectors that all have slightly different color gamuts. The color gamuts are represented by a triangle in the CIE chromaticity space. Here is a picture showing a few color gamuts in chromaticity space.
color gamut



I need to restrict the lager gamut projectors so that all the projectors have the same gamut. I need to find the "greatest common gamut". Which I think boils down to finding the intersection of all 16 gamuts and drawing a triangle between the 3 vertices of the resulting polygon that are closest to the RGB "corners" of chromaticity space.



Is there a closed-form solution to finding the intersection of several triangles? Also I am assuming the intersection operator is associative right? ie ( A int B int C) = ( (A int B) int C ) = ( A int (B int C))? Sorry I don't know how to do the symbols :( Also does anyone know of functions or libraries in Matlab / Octave to find the intersection of polygons? Sorry if I used the wrong terminology anywhere I am not very knowledgeable when it comes to math.







geometry euclidean-geometry analytic-geometry computational-geometry






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Jan 8 at 19:33









Glorfindel

3,41981830




3,41981830










asked Dec 27 '12 at 21:30









vanattabvanattab

1657




1657












  • $begingroup$
    Any ideas at all?
    $endgroup$
    – vanattab
    Dec 29 '12 at 23:11


















  • $begingroup$
    Any ideas at all?
    $endgroup$
    – vanattab
    Dec 29 '12 at 23:11
















$begingroup$
Any ideas at all?
$endgroup$
– vanattab
Dec 29 '12 at 23:11




$begingroup$
Any ideas at all?
$endgroup$
– vanattab
Dec 29 '12 at 23:11










1 Answer
1






active

oldest

votes


















2












$begingroup$

There are lots of algorithms for computing the intersection of two convex polygons. For example, O'Rourke et al.'s 1982 paper "A new linear algorithm for intersecting convex polygons" (also described in the book Computational Geometry in C, and online in Amar Mukherjee's lecture notes on Intersection Problems), or Toussaint's 1985 paper "A simple linear algorithm for intersecting convex polygons" (which is available online).



Alternatively, you can use a polygon clipping approach, such as the Sutherland-Hodgman algorithm. The Wikipedia article has nice pseudocode, so this might be easier to implement for you. Clipping can give you duplicated vertices, but I don't think that's a problem for your application.



In either case, you start with the first triangle, intersect/clip it with the second triangle, intersect/clip the resulting polygon with the third triangle, and so on. In the end you get the polygon that is the intersection of all of them, because yes, intersection is associative. (Clipping of convex polygons is the same, apart from the duplicated vertices.)






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%2f266135%2fhow-to-find-the-intersection-of-the-area-of-multiple-triangles%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









    2












    $begingroup$

    There are lots of algorithms for computing the intersection of two convex polygons. For example, O'Rourke et al.'s 1982 paper "A new linear algorithm for intersecting convex polygons" (also described in the book Computational Geometry in C, and online in Amar Mukherjee's lecture notes on Intersection Problems), or Toussaint's 1985 paper "A simple linear algorithm for intersecting convex polygons" (which is available online).



    Alternatively, you can use a polygon clipping approach, such as the Sutherland-Hodgman algorithm. The Wikipedia article has nice pseudocode, so this might be easier to implement for you. Clipping can give you duplicated vertices, but I don't think that's a problem for your application.



    In either case, you start with the first triangle, intersect/clip it with the second triangle, intersect/clip the resulting polygon with the third triangle, and so on. In the end you get the polygon that is the intersection of all of them, because yes, intersection is associative. (Clipping of convex polygons is the same, apart from the duplicated vertices.)






    share|cite|improve this answer











    $endgroup$


















      2












      $begingroup$

      There are lots of algorithms for computing the intersection of two convex polygons. For example, O'Rourke et al.'s 1982 paper "A new linear algorithm for intersecting convex polygons" (also described in the book Computational Geometry in C, and online in Amar Mukherjee's lecture notes on Intersection Problems), or Toussaint's 1985 paper "A simple linear algorithm for intersecting convex polygons" (which is available online).



      Alternatively, you can use a polygon clipping approach, such as the Sutherland-Hodgman algorithm. The Wikipedia article has nice pseudocode, so this might be easier to implement for you. Clipping can give you duplicated vertices, but I don't think that's a problem for your application.



      In either case, you start with the first triangle, intersect/clip it with the second triangle, intersect/clip the resulting polygon with the third triangle, and so on. In the end you get the polygon that is the intersection of all of them, because yes, intersection is associative. (Clipping of convex polygons is the same, apart from the duplicated vertices.)






      share|cite|improve this answer











      $endgroup$
















        2












        2








        2





        $begingroup$

        There are lots of algorithms for computing the intersection of two convex polygons. For example, O'Rourke et al.'s 1982 paper "A new linear algorithm for intersecting convex polygons" (also described in the book Computational Geometry in C, and online in Amar Mukherjee's lecture notes on Intersection Problems), or Toussaint's 1985 paper "A simple linear algorithm for intersecting convex polygons" (which is available online).



        Alternatively, you can use a polygon clipping approach, such as the Sutherland-Hodgman algorithm. The Wikipedia article has nice pseudocode, so this might be easier to implement for you. Clipping can give you duplicated vertices, but I don't think that's a problem for your application.



        In either case, you start with the first triangle, intersect/clip it with the second triangle, intersect/clip the resulting polygon with the third triangle, and so on. In the end you get the polygon that is the intersection of all of them, because yes, intersection is associative. (Clipping of convex polygons is the same, apart from the duplicated vertices.)






        share|cite|improve this answer











        $endgroup$



        There are lots of algorithms for computing the intersection of two convex polygons. For example, O'Rourke et al.'s 1982 paper "A new linear algorithm for intersecting convex polygons" (also described in the book Computational Geometry in C, and online in Amar Mukherjee's lecture notes on Intersection Problems), or Toussaint's 1985 paper "A simple linear algorithm for intersecting convex polygons" (which is available online).



        Alternatively, you can use a polygon clipping approach, such as the Sutherland-Hodgman algorithm. The Wikipedia article has nice pseudocode, so this might be easier to implement for you. Clipping can give you duplicated vertices, but I don't think that's a problem for your application.



        In either case, you start with the first triangle, intersect/clip it with the second triangle, intersect/clip the resulting polygon with the third triangle, and so on. In the end you get the polygon that is the intersection of all of them, because yes, intersection is associative. (Clipping of convex polygons is the same, apart from the duplicated vertices.)







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Dec 31 '12 at 17:26

























        answered Dec 31 '12 at 17:15









        RahulRahul

        33k568168




        33k568168






























            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%2f266135%2fhow-to-find-the-intersection-of-the-area-of-multiple-triangles%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

            MongoDB - Not Authorized To Execute Command

            How to fix TextFormField cause rebuild widget in Flutter

            in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith