Coder Social home page Coder Social logo

doleron / tetrahedron-4th-vertex Goto Github PK

View Code? Open in Web Editor NEW
3.0 0.0 0.0 335 KB

Demonstration of finding the 4th vertex of a tetrahedron given its base and distances to 4th vertex

License: MIT License

HTML 0.12% JavaScript 99.88%
geometry 3d tetrahedron

tetrahedron-4th-vertex's Introduction

tetrahedron-4th-vertex

Demonstration of finding the 4th vertex of a tetrahedron given its base and distances to vertex

Problem definition

Consider a Tetrahedron in the regular cartesian space defined by:

  • Points P, Q and R
  • Distances , and from the respectives points P, Q and R to the unknown 4th vertex E

The problem consists on finding the (x, y, z) coordinates of the point E.

Solution

Although there are other solutions using intersections of spheres or planes, this problem can be solved by regular trigonometric approach.

Note that θ is the angle between the unknow vector and the plane defined by the points P, Q and R. σ is the angle between the projection of on the same plane PQR and the vector .

As the image suggests, σ and θ can be obtained in a straightforward way from the tetrahedron height and elementary trigonometric properties, as shown below.

Finding angles σ and θ

  1. Find the tetrahedron Volume using Calyer-Menger determinant:

  1. Find the Area of triangle P, Q, R using Heron's formula:

Area using Heron's formula

  1. Find the tetrahedron height H using the relationship between Volume and Area:

  1. Find θ:

obtaining theta from height

Once we have θ the next step is to find the length of the projections and onto the plane defined by P, Q and R:

  1. Thus, using the Law of Cosines, σ is given by:

Once we have P, , σ and θ we know everything we need to find E.

Finding E given σ, θ, P and

There are several ways to obtain E(x, y, z), one of them is rotating by σ and then rotating again by θ, as demonstrated below.

  1. Find the PQR triangle normal :

  1. Rotate about by -σ using Rodrigues' formula:

  1. Find the normal from and :

  1. Rotate by -θ about :

  1. Get the unit vector from and multiply it by in order to obtain :

Finally, E is given by

It is noteworthy that the symmetric solution can be find by rotating about by +θ (instead of -θ):

Different approaches

This same problem can be solved by finding the intersection of the 3 spheres centered on P, Q and R and respective radius , and .

Another approach is by finding the intersection of planes PER, PQE and REQ.

Future work

One of my future work is checking out if this approach is less computational intensive than others.

Acknowledgements

I would like to thanks to github markup team for not provide a simple way to write math expressions on markdown documents. Thus, in order to provide the formulas I ended up using this formula image generator: https://www.codecogs.com/latex/eqneditor.php. For more details see github/markup#897.

tetrahedron-4th-vertex's People

Contributors

doleron avatar

Stargazers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.