PDA

View Full Version : mathematica tetrahedron


jemma
Aug24-10, 10:12 PM
I want to make a tetrahedron in mathematica. For example, suppose:

{a = 0.2, b = 0.5, c = 0.1, d = 0.3}
{a = 0.1, b = 0.2, c = 0.4, d = 0.3}
{a = 0.4, b = 0.3, c = 0.2, d = 0.1}
{a = 0.6, b = 0.2, c = 0.1, d = 0.1}

and I want a tetrahedrom so that the four points are a, b, c and d - and the values are plotted within the space (each set with a unique symbol such as circles, squares, etc)

Thanks in advance if you can help!

Bill Simpson
Aug25-10, 08:19 PM
Do you mean to give each point x,y,z coordinates?

If so then perhaps something like this

a={0.2,0.5,0.1};b={0.1,0.2,0.4};c={0.4,0.3,0.2};d= {0.6,0.2,0.1};
Show[Graphics3D[{Polygon[{a,b,c}], Polygon[{a,b,d}],Polygon[{b,c,d}],Polygon[{c,a,d}]}]]

jemma
Aug25-10, 08:29 PM
Thank you very much for your suggestion. Sorry for not being more clear - I mean each point of the tetrahedron is a, b, c and d. Basically I want something that looks like this:

http://books.google.co.nz/books?id=flmuDNNpYTIC&pg=PA261&lpg=PA261&dq=tetrahedron+for+allele+equilibrium&source=bl&ots=2jSCBxTbq3&sig=nWoxcRGxZU7RcXM4uQXj63tqLQo&hl=en&ei=QYN0TPG7G87BcZKGyYsG&sa=X&oi=book_result&ct=result&resnum=3&ved=0CCIQ6AEwAg#v=onepage&q=tetrahedron%20for%20allele%20equilibrium&f=false

(page 261 of Evolutionary genetics: from molecules to morphology)