Determine if a point is in a hyperellipsoid












1












$begingroup$


I'm implementing an algorithm for a scientific application that requires determining if a set of points is inside an n-dimensional ellipsoid (hyper-ellipsoid). I have this working for the 2-d and 3-d cases, but I am not sure of how to proceed for cases of 4 or more dimensions.



Can a hyper-ellipsoid of n-dimensions be treated as a set of all the unique 3-d ellipsoid combinations?



This seems like it would not be the case given that two ellipses in 3-dimensions (each sharing a dimension) do not include all the points of the 3-d ellipsoid that covers their boundaries.



For the 3-d case, I am using the criterion:
$$
left( {x over a} right) ^2 + left({y over b}right) ^2 + left({z over c}right) ^2 le 1
$$



for inclusion, where:




  • a, b, and c are the half-lengths of the ellipsoid's axes

  • x, y, and z are the coordinates of a point


Note: In this implementation, points on the surface are counted as inside the ellipsoid.










share|cite|improve this question











$endgroup$












  • $begingroup$
    Is there anything stopping you from using an inequality like $left(dfrac{x}{a}right)^{!2}+left(dfrac{y}{b}right)^{!2}+left(dfrac{z}{c}right)^{!2}+left(dfrac{w}{d}right)^{!2}le 1?$
    $endgroup$
    – Adrian Keister
    Jan 30 at 16:06










  • $begingroup$
    @AdrianKeister Thanks, does the pattern of summing these squares hold true for n-dimenstions?
    $endgroup$
    – Fiver
    Jan 30 at 16:19










  • $begingroup$
    Yep! It's what we call Euclidean distance, and it generalizes to $n$ dimensions.
    $endgroup$
    – Adrian Keister
    Jan 30 at 16:21






  • 1




    $begingroup$
    Excellent, that's easy then. If you add this as an answer, I'll accept. Thanks again!
    $endgroup$
    – Fiver
    Jan 30 at 16:28
















1












$begingroup$


I'm implementing an algorithm for a scientific application that requires determining if a set of points is inside an n-dimensional ellipsoid (hyper-ellipsoid). I have this working for the 2-d and 3-d cases, but I am not sure of how to proceed for cases of 4 or more dimensions.



Can a hyper-ellipsoid of n-dimensions be treated as a set of all the unique 3-d ellipsoid combinations?



This seems like it would not be the case given that two ellipses in 3-dimensions (each sharing a dimension) do not include all the points of the 3-d ellipsoid that covers their boundaries.



For the 3-d case, I am using the criterion:
$$
left( {x over a} right) ^2 + left({y over b}right) ^2 + left({z over c}right) ^2 le 1
$$



for inclusion, where:




  • a, b, and c are the half-lengths of the ellipsoid's axes

  • x, y, and z are the coordinates of a point


Note: In this implementation, points on the surface are counted as inside the ellipsoid.










share|cite|improve this question











$endgroup$












  • $begingroup$
    Is there anything stopping you from using an inequality like $left(dfrac{x}{a}right)^{!2}+left(dfrac{y}{b}right)^{!2}+left(dfrac{z}{c}right)^{!2}+left(dfrac{w}{d}right)^{!2}le 1?$
    $endgroup$
    – Adrian Keister
    Jan 30 at 16:06










  • $begingroup$
    @AdrianKeister Thanks, does the pattern of summing these squares hold true for n-dimenstions?
    $endgroup$
    – Fiver
    Jan 30 at 16:19










  • $begingroup$
    Yep! It's what we call Euclidean distance, and it generalizes to $n$ dimensions.
    $endgroup$
    – Adrian Keister
    Jan 30 at 16:21






  • 1




    $begingroup$
    Excellent, that's easy then. If you add this as an answer, I'll accept. Thanks again!
    $endgroup$
    – Fiver
    Jan 30 at 16:28














1












1








1





$begingroup$


I'm implementing an algorithm for a scientific application that requires determining if a set of points is inside an n-dimensional ellipsoid (hyper-ellipsoid). I have this working for the 2-d and 3-d cases, but I am not sure of how to proceed for cases of 4 or more dimensions.



Can a hyper-ellipsoid of n-dimensions be treated as a set of all the unique 3-d ellipsoid combinations?



This seems like it would not be the case given that two ellipses in 3-dimensions (each sharing a dimension) do not include all the points of the 3-d ellipsoid that covers their boundaries.



For the 3-d case, I am using the criterion:
$$
left( {x over a} right) ^2 + left({y over b}right) ^2 + left({z over c}right) ^2 le 1
$$



for inclusion, where:




  • a, b, and c are the half-lengths of the ellipsoid's axes

  • x, y, and z are the coordinates of a point


Note: In this implementation, points on the surface are counted as inside the ellipsoid.










share|cite|improve this question











$endgroup$




I'm implementing an algorithm for a scientific application that requires determining if a set of points is inside an n-dimensional ellipsoid (hyper-ellipsoid). I have this working for the 2-d and 3-d cases, but I am not sure of how to proceed for cases of 4 or more dimensions.



Can a hyper-ellipsoid of n-dimensions be treated as a set of all the unique 3-d ellipsoid combinations?



This seems like it would not be the case given that two ellipses in 3-dimensions (each sharing a dimension) do not include all the points of the 3-d ellipsoid that covers their boundaries.



For the 3-d case, I am using the criterion:
$$
left( {x over a} right) ^2 + left({y over b}right) ^2 + left({z over c}right) ^2 le 1
$$



for inclusion, where:




  • a, b, and c are the half-lengths of the ellipsoid's axes

  • x, y, and z are the coordinates of a point


Note: In this implementation, points on the surface are counted as inside the ellipsoid.







geometry






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Jan 30 at 16:18







Fiver

















asked Jan 30 at 15:38









FiverFiver

1105




1105












  • $begingroup$
    Is there anything stopping you from using an inequality like $left(dfrac{x}{a}right)^{!2}+left(dfrac{y}{b}right)^{!2}+left(dfrac{z}{c}right)^{!2}+left(dfrac{w}{d}right)^{!2}le 1?$
    $endgroup$
    – Adrian Keister
    Jan 30 at 16:06










  • $begingroup$
    @AdrianKeister Thanks, does the pattern of summing these squares hold true for n-dimenstions?
    $endgroup$
    – Fiver
    Jan 30 at 16:19










  • $begingroup$
    Yep! It's what we call Euclidean distance, and it generalizes to $n$ dimensions.
    $endgroup$
    – Adrian Keister
    Jan 30 at 16:21






  • 1




    $begingroup$
    Excellent, that's easy then. If you add this as an answer, I'll accept. Thanks again!
    $endgroup$
    – Fiver
    Jan 30 at 16:28


















  • $begingroup$
    Is there anything stopping you from using an inequality like $left(dfrac{x}{a}right)^{!2}+left(dfrac{y}{b}right)^{!2}+left(dfrac{z}{c}right)^{!2}+left(dfrac{w}{d}right)^{!2}le 1?$
    $endgroup$
    – Adrian Keister
    Jan 30 at 16:06










  • $begingroup$
    @AdrianKeister Thanks, does the pattern of summing these squares hold true for n-dimenstions?
    $endgroup$
    – Fiver
    Jan 30 at 16:19










  • $begingroup$
    Yep! It's what we call Euclidean distance, and it generalizes to $n$ dimensions.
    $endgroup$
    – Adrian Keister
    Jan 30 at 16:21






  • 1




    $begingroup$
    Excellent, that's easy then. If you add this as an answer, I'll accept. Thanks again!
    $endgroup$
    – Fiver
    Jan 30 at 16:28
















$begingroup$
Is there anything stopping you from using an inequality like $left(dfrac{x}{a}right)^{!2}+left(dfrac{y}{b}right)^{!2}+left(dfrac{z}{c}right)^{!2}+left(dfrac{w}{d}right)^{!2}le 1?$
$endgroup$
– Adrian Keister
Jan 30 at 16:06




$begingroup$
Is there anything stopping you from using an inequality like $left(dfrac{x}{a}right)^{!2}+left(dfrac{y}{b}right)^{!2}+left(dfrac{z}{c}right)^{!2}+left(dfrac{w}{d}right)^{!2}le 1?$
$endgroup$
– Adrian Keister
Jan 30 at 16:06












$begingroup$
@AdrianKeister Thanks, does the pattern of summing these squares hold true for n-dimenstions?
$endgroup$
– Fiver
Jan 30 at 16:19




$begingroup$
@AdrianKeister Thanks, does the pattern of summing these squares hold true for n-dimenstions?
$endgroup$
– Fiver
Jan 30 at 16:19












$begingroup$
Yep! It's what we call Euclidean distance, and it generalizes to $n$ dimensions.
$endgroup$
– Adrian Keister
Jan 30 at 16:21




$begingroup$
Yep! It's what we call Euclidean distance, and it generalizes to $n$ dimensions.
$endgroup$
– Adrian Keister
Jan 30 at 16:21




1




1




$begingroup$
Excellent, that's easy then. If you add this as an answer, I'll accept. Thanks again!
$endgroup$
– Fiver
Jan 30 at 16:28




$begingroup$
Excellent, that's easy then. If you add this as an answer, I'll accept. Thanks again!
$endgroup$
– Fiver
Jan 30 at 16:28










1 Answer
1






active

oldest

votes


















1












$begingroup$

You can use Euclidean distance and generalize the formula you already have:
$$left(dfrac{x}{a}right)^{!2}+left(dfrac{y}{b}right)^{!2}+left(dfrac{z}{c}right)^{!2}+left(dfrac{w}{d}right)^{!2}le 1.$$
More dimensions will simply add more terms: variable squared over half-axis-lengths squared.






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%2f3093688%2fdetermine-if-a-point-is-in-a-hyperellipsoid%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









    1












    $begingroup$

    You can use Euclidean distance and generalize the formula you already have:
    $$left(dfrac{x}{a}right)^{!2}+left(dfrac{y}{b}right)^{!2}+left(dfrac{z}{c}right)^{!2}+left(dfrac{w}{d}right)^{!2}le 1.$$
    More dimensions will simply add more terms: variable squared over half-axis-lengths squared.






    share|cite|improve this answer









    $endgroup$


















      1












      $begingroup$

      You can use Euclidean distance and generalize the formula you already have:
      $$left(dfrac{x}{a}right)^{!2}+left(dfrac{y}{b}right)^{!2}+left(dfrac{z}{c}right)^{!2}+left(dfrac{w}{d}right)^{!2}le 1.$$
      More dimensions will simply add more terms: variable squared over half-axis-lengths squared.






      share|cite|improve this answer









      $endgroup$
















        1












        1








        1





        $begingroup$

        You can use Euclidean distance and generalize the formula you already have:
        $$left(dfrac{x}{a}right)^{!2}+left(dfrac{y}{b}right)^{!2}+left(dfrac{z}{c}right)^{!2}+left(dfrac{w}{d}right)^{!2}le 1.$$
        More dimensions will simply add more terms: variable squared over half-axis-lengths squared.






        share|cite|improve this answer









        $endgroup$



        You can use Euclidean distance and generalize the formula you already have:
        $$left(dfrac{x}{a}right)^{!2}+left(dfrac{y}{b}right)^{!2}+left(dfrac{z}{c}right)^{!2}+left(dfrac{w}{d}right)^{!2}le 1.$$
        More dimensions will simply add more terms: variable squared over half-axis-lengths squared.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Jan 30 at 16:37









        Adrian KeisterAdrian Keister

        5,26971933




        5,26971933






























            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%2f3093688%2fdetermine-if-a-point-is-in-a-hyperellipsoid%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

            Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

            ts Property 'filter' does not exist on type '{}'

            mat-slide-toggle shouldn't change it's state when I click cancel in confirmation window