summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tikz-3dplot/tikz-3dplot.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikz-3dplot/tikz-3dplot.sty')
-rw-r--r--Master/texmf-dist/tex/latex/tikz-3dplot/tikz-3dplot.sty27
1 files changed, 25 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/latex/tikz-3dplot/tikz-3dplot.sty b/Master/texmf-dist/tex/latex/tikz-3dplot/tikz-3dplot.sty
index 4873efb424d..6b92c48a855 100644
--- a/Master/texmf-dist/tex/latex/tikz-3dplot/tikz-3dplot.sty
+++ b/Master/texmf-dist/tex/latex/tikz-3dplot/tikz-3dplot.sty
@@ -107,6 +107,17 @@
\pgfmathsetmacro{\tdplotmaintheta}{#1}
\pgfmathsetmacro{\tdplotmainphi}{#2}
%
+
+\tdplotcalctransformmainscreen
+
+%now here is where the output is performed
+\tikzset{tdplot_main_coords/.style={x={(\raarot cm,\rbarot cm)},y={(\rabrot cm, \rbbrot cm)},z={(\racrot cm, \rbcrot cm)}}}%
+}
+
+
+%This performs the calculation to define the main coordinate frame orientation style, and is also used to transform a coordinate from the main coordinate frame the the screen coordinate frame
+\newcommand{\tdplotcalctransformmainscreen}{%
+
%TODO: choose less obvious macro names? or look into scoping?
\tdplotsinandcos{\sintheta}{\costheta}{\tdplotmaintheta}%
\tdplotsinandcos{\sinphi}{\cosphi}{\tdplotmainphi}%
@@ -129,10 +140,13 @@
\pgfmathsetmacro{\rcbrot}{-\stcp}%
\pgfmathsetmacro{\rccrot}{\costheta}%
%
-%now here is where the output is performed
-\tikzset{tdplot_main_coords/.style={x={(\raarot cm,\rbarot cm)},y={(\rabrot cm, \rbbrot cm)},z={(\racrot cm, \rbcrot cm)}}}%
+
+
}
+
+
+
%determines the rotation matrix for transformation from the rotation coordinate frame to the main coordinate frame. This also defines the rotation to produce the rotated coordinate frame.
\newcommand{\tdplotcalctransformrotmain}{%
%perform some trig for the Euler transformation
@@ -243,6 +257,15 @@
}
+%transforms a coordinate from the main coordinate frame to the rotated coordinate frame
+\newcommand{\tdplottransformmainscreen}[3]{%
+ \tdplotcalctransformmainscreen
+
+ \pgfmathsetmacro{\tdplotresx}{\raarot * #1 + \rabrot * #2 + \racrot * #3}
+ \pgfmathsetmacro{\tdplotresy}{\rbarot * #1 + \rbbrot * #2 + \rbcrot * #3}
+}
+
+
%\tdplotsetrotatedcoords{\alpha}{\beta}{\gamma}
%generates the coordinate transformation for the rotated coordinate system within the display coordinate system. This should be called only after the display coordinate system has been defined. If the display coordinate system changes, this will have to be updated.