Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to draw some points with TikZ.

I'm using this code:

\begin{tikzpicture}[scale=0.5]
\draw (4.0,2.4492) -- (4.8984,-4.0);
\draw (4.0,2.4492) -- (-4.0,-7.347);
\draw (4.0,2.4492) -- (-9.796,4.0);
\draw (4.8984,-4.0) -- (-4.0,-7.347);
\draw (4.8984,-4.0) -- (-9.796,4.0);
\draw (-4.0,-7.347) -- (-9.796,4.0);
\end{tikzpicture}

I'm generated this code with a Python program using OpenGL. In my render all this are done perfectly: a perfect square with diagonals, but in latex with TikZ I'm getting the first point of the square not aligned (sorry i can't post images yet). Some helps?


Added an image for you (with grid and origin marked):

rendered by pdfLaTeX

share|improve this question
    
Your code seems to be ok. As I see it TikZ simply draws what you request. No idea, why it gives you are different result in the OpenGL renderer. My guess it you export the coordinates in a wrong way. –  Martin Scharrer Mar 27 '11 at 11:36
    
thanks for the image! –  nkint Mar 27 '11 at 14:35
    
i resolved! i was stucking on exporting 1.2246063538223773e-16 as 1.22 and other similar error. thanks to point me in better examing coordinates throug grid! –  nkint Mar 27 '11 at 16:06
    
Then I guess we can close this. @Martin: Do you want to add an answer? –  Caramdir Mar 27 '11 at 16:20
    
@Caramdir: No, I don't. (But I already thought about some rounding/conversion error as cause.). I will close it now as suggested. –  Martin Scharrer Mar 27 '11 at 16:24
add comment

closed as too localized by Caramdir, Martin Scharrer Mar 27 '11 at 16:24

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.