Kamis, 17 Oktober 2024

Cube In Latex

  1. type this following latex code in latex editor:
%!TEX TS-program = pdflatex
%!TEX encoding = UTF-8 Unicode
%Typeset/Build program
\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikz,tikz-3dplot}
\usepackage{mathptmx}
\usepackage{amsfonts}
\begin{document}
    \tdplotsetmaincoords{70}{120}
\begin{tikzpicture}[tdplot_main_coords,line cap=butt,line join=round,c/.style={circle,fill,inner sep=1pt},
        declare function={a=2;}]
        \path
        (a,-a,-a) coordinate (A)
        (a,a,-a) coordinate (B)
        (-a,a,-a) coordinate (C)
        (-a,-a,-a) coordinate (D)
        (a,-a,a) coordinate (E)
        (a,a,a) coordinate (F)
        (-a,a,a) coordinate (G)
        (-a,-a,a) coordinate (H)
        (0,0,0)  coordinate (O)
        ;
\draw[thick,dashed] (D) -- (H) (D) -- (A) (D) -- (C);
\draw[thick] (H) -- (E) -- (F) -- (G) -- cycle (A) -- (E) (B) -- (F) (C) -- (G) (A) -- (B) -- (C);
\path foreach \p/\g in {A/-90,B/-90,C/-90,D/-90,E/90,F/90,G/90,H/90}{(\p)node[c]{}+(\g:2.5mm) node{$\mathbf{\p}$}};  
\end{tikzpicture}
\end{document}
  1. save file as drawCube7sample.tex
  2. Run latex compiler command.
  3. to see the output picture, click : Kubus dan Balok >
Next click Cuboid In Latex >


latex equation, latex formula, tex math and science document sample, latex math and science document example, latex draw, drawing in latex, latex graphic, mathematics, science

Tidak ada komentar:

Posting Komentar

Various Other Posts