Eric and others,
An algorithm for converting from barycentric to cartesian coordinates
for a quarternary (tetrahedral) system was published by me in Am Min
(Spear, F. S., 1980. Plotting steroscopic phase diagrams. American
Mineralogist, 65, 1291-1293.) I have a Fortran program (for Macintosh
only) that will read analyses and make the plots, in either mono or
stereo views. It's a bit old but should still work. I am happy to
distribute the program and the source code if anyone wants to make a
PC version.
You can also do the calculations on a spreadsheet. The coordinate
transformation is accomplished as shown in the Fortran code below. I
checked it on EXCEL, and it works fine
(remember that angles are in radians).
If G = 0, only 1 view is created. If G > 0 then stereo pairs
are created. E should be around 10. XL, YL and ZL are the left
views. XR, YR and ZR are the right views.
In EXCEL its a bit of a trick to plot
all the tie-lines for the tetrahedron. It works if you plot the
tetrahedron as
Barycentric coords
1 2 3 4
--------------------------
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
0 1 0 0
0 0 1 0
1 0 0 0
0 0 0 1
If I look really hard, I might be able to find this spreadsheet if
anyone wants it.
cheers,
Frank Spear
SUBROUTINE PROJEC(BARY,A,T,G,E,XL,YL,XR,YR)
c
c routine to compute cartesian coordinates from 4-component
c barycentric coordinates and then to rotate through angles
c a(alpha), T(theta)
c stereoscopic projection is made with an interpupilary angle
c of G(gamma) and an eyedistance of E
c
DIMENSION BARY(4)
save
X=((BARY(1)-.25)+.5*(BARY(2)-.25)+.5*(BARY(4)-.25))/0.8165
Y=((BARY(2)-.25)+.333333*(BARY(4)-.25))/0.9428
Z=BARY(4)-.25
X2=X*COS(A)-Y*SIN(A)
Y2=(X*SIN(A)+Y*COS(A))*COS(T)+Z*SIN(T)
Z2=Z*COS(T)-SIN(T)*(X*SIN(A)+Y*COS(A))
ZL=Z2*COS(G/2)-X2*SIN(G/2)
XL=(X2*COS(G/2)+Z2*SIN(G/2))*E/(E-ZL)
YL=Y2*E/(E-ZL)
ZR=X2*SIN(G/2)+Z2*COS(G/2)
XR=(X2*COS(G/2)-Z2*SIN(G/2))*E/(E-ZR)
YR=Y2*E/(E-ZR)
RETURN
END
>Hi all,
>
> I was wondering if anyone out there knows a
>good quarternary (tedrahedron) diagram maker.
>
> If anyone knows of such a program I'd be glad
>to hear from you.
>
> Cheers
>
> Erich
> *****************************
>Erich Knop
>Institut für Mineralogie und Petrographie der
>Leopold-Franzens-Universität Innsbruck
>Innrain 52
>A-6020 Innsbruck
>AUSTRIA
>Phone ++43 (0)512 507 5505
>Fax ++43 (0)512 507 2926
>EMail [log in to unmask]
>http://www.uibk.ac.at/c/c7/c714/
----------------------------------------------
Frank Spear
Professor and Chair
Department of Earth and Environmental Sciences, JRSC 1C25
Rensselaer Polytechnic Institute
Troy, New York 12180
Phone (office): 518-276-6103
(lab) : 518-276-4899
Fax: 518-276-6680
http://www.rpi.edu/dept/geo/spear/spear.html
|