-1

3D form will be how to draw this picture? parabola, circle, ellipse and hyperbola 3D

  • 4
    Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document. – JP-Ellis Dec 17 '16 at 03:00
  • 2
    I don't really understand your question. The image doesn't seem to be 3D and none of the mentioned elements are themselves 3D: just curves in 2D. – cfr Dec 17 '16 at 03:12
  • See last example at http://tug.org/PSTricks/main.cgi?file=Examples/Gallery3D/Gallery3D –  Dec 19 '16 at 12:01

2 Answers2

6

Ok, since I remembered this question that has a "3D" cone already done we can steal the code there and that saves as half the trouble. In reality, the 2D drawing looks like this (when there's no perspective - \p=0):

enter image description here

Where the colored lines are planes cutting the cone. From Mark Wibrow's answer we can use the calculated \rx and \ry values to find the starting position of our hyperbola and parabola, and also define the bend coordinate of those. The important thing for perspective is that this bend is tangent to the cone edge, so we also calculate the tangency angle (which must be given as parameters for making the cone. At last, given some perpesctive (0<\p<1) to the previous drawing it looks like this:

enter image description here

MWE

% Most of the code is taken from https://tex.stackexchange.com/a/332015/81905
%Courtesy of Mark Wibrow
\documentclass[border=5]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[parabola/.style={very thin, red}, hyperbola/.style={very thin, violet}, circle/.style={very thin, blue}]
\def\b{2}
\def\h{2}
\def\p{0.5}
\pgfmathsetmacro{\rx}{\b/2}
\pgfmathsetmacro{\ry}{\rx*\p}
\pgfmathsetmacro{\ta}{90-atan2(\h,\ry)}
\fill[gray!50]
(0, \h) -- (\ta:\rx+0 and \ry) arc (\ta:180-\ta:\rx+0 and \ry) -- cycle;
\fill[gray!75] coordinate (bottom) ellipse [x radius=\rx, y radius=\ry];
\draw[dashed] (\ta:\rx+0 and \ry) arc (\ta:180-\ta:\rx+0 and \ry);
\draw (0, \h) -- (\ta:\rx+0 and \ry) arc (\ta:-180-\ta:\rx+0 and \ry) -- coordinate[pos=.4](hypbend) cycle;
\begin{scope}[rotate around={180:(0,\h)}]
\fill[gray!50]
(0, \h) -- (\ta:\rx+0 and \ry) arc (\ta:180-\ta:\rx+0 and \ry) -- cycle;
\fill[gray!75] coordinate (top) ellipse [x radius=\rx, y radius=\ry];
\draw (\ta:\rx+0 and \ry) arc (\ta:180-\ta:\rx+0 and \ry) (0, \h) -- coordinate[pos=.3](parabend) (\ta:\rx+0 and \ry) arc (\ta:-180-\ta:\rx+0 and \ry) -- cycle;
\end{scope}
%% Dots & Axis
\fill (top) circle[radius=1pt] (0,\h) circle[radius=1pt] (bottom) circle[radius=1pt];
\draw[dotted] (top) -- (bottom);
\draw (top) -- ++(-90:\rx+0 and \ry);
%% Parabola
\path (top) +(50+50*\p:\rx+0 and \ry) coordinate (tmp) +(-50+50*\p:\rx+0 and \ry) coordinate (tmp2);
\draw[parabola] (tmp) ..controls ++(-90:0) and ++(\ta+90:\p).. (parabend) node[left]{Parabola} ..controls ++(\ta-90:\p) and ++(-90:0).. (tmp2);
%% Circle
\def\pos{0.5}
\draw[circle] (0,\pos*\h) ellipse [x radius=\pos*\rx, y radius=\pos*\ry] +(180:\pos*\rx) node[above left]{Circle};
%% Hyperbola
\path (bottom) +(130-50*\p:\rx+0 and \ry) coordinate (tmp) +(230+50*\p:\rx+0 and \ry) coordinate (tmp2);
\draw[hyperbola] (tmp) ..controls ++(90:0) and ++(90-\ta:0.6*\p).. (hypbend) node[left]{Hyperbola} ..controls ++(-\ta-90:0.6*\p) and ++(90:0).. (tmp2);
\end{tikzpicture}
\end{document}

You can play around with the perspective value to get it better adjusted. And please, do take note that I don't claim this drawing to be truthfully when it comes to 3D, this is merely an ilusion of perspective, I did not calculate anything to ensure truthful perception of depth!!

0

please, I'm making some modifications.For now I need to add the plane that intersects the cones and see that the intersection is the conic sought

\documentclass[12pt,a4paper]{article}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amscd}
\usepackage[latin2]{inputenc}
\usepackage{t1enc}
\usepackage[mathscr]{eucal}
\usepackage{indentfirst}
\usepackage{graphicx}
\usepackage{graphics}
\usepackage{pict2e}
\usepackage{epic}
\numberwithin{equation}{section}
\usepackage{epstopdf} 
\usepackage{pgf,tikz,tkz-euclide}
\usepackage{tikz-3dplot}
\usetikzlibrary{calc,patterns,angles,quotes,arrows,intersections,through,backgrounds,arrows.meta}
\usetkzobj{all}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{patterns}
\title{Conicas : }
\begin{document}
\maketitle
\begin{center}
\begin{tikzpicture}[parabola/.style={very thin, red}, hyperbola/.style={very thin, violet}, circle/.style={very thin, blue}]
\def\b{2}
\def\h{2}
\def\p{0.5}
\pgfmathsetmacro{\rx}{\b/2}
\pgfmathsetmacro{\ry}{\rx*\p}
\pgfmathsetmacro{\ta}{90-atan2(\h,\ry)}

\fill[white](0, \h) -- (\ta:\rx+0 and \ry) arc (\ta:180-\ta:\rx+0 and \ry) -- cycle;
\fill[white] coordinate (bottom) ellipse [x radius=\rx, y radius=\ry];
\draw[dashed] (\ta:\rx+0 and \ry) arc (\ta:180-\ta:\rx+0 and \ry);
\draw (0, \h) -- (\ta:\rx+0 and \ry) arc (\ta:-180-\ta:\rx+0 and \ry) -- coordinate[pos=.4](hypbend) cycle;
\begin{scope}[rotate around={180:(0,\h)}]
\fill[white](0, \h) -- (\ta:\rx+0 and \ry) arc (\ta:180-\ta:\rx+0 and \ry) -- cycle;
\fill[white] coordinate (top) ellipse [x radius=\rx, y radius=\ry];
\draw (\ta:\rx+0 and \ry) arc (\ta:180-\ta:\rx+0 and \ry) (0, \h) -- coordinate[pos=.3](parabend) (\ta:\rx+0 and \ry) arc (\ta:-180-\ta:\rx+0 and \ry) -- cycle;
\end{scope}

%% Parabola
\path (top) +(50+50*\p:\rx+0 and \ry) coordinate (tmp) +(-50+50*\p:\rx+0 and \ry) coordinate (tmp2);
\fill[parabola,gray!50] (tmp) ..controls ++(-90:0) and ++(\ta+90:\p).. (parabend) node[left]{Parabola} ..controls ++(\ta-90:\p) and ++(-90:0).. (tmp2);

%% Dots & Axis
\fill (top) circle[radius=1pt] (0,\h) circle[radius=1pt] (bottom) circle[radius=1pt];
\draw[dotted] (top) -- (bottom);
\draw (top) -- ++(-90:\rx+0 and \ry);
\end{tikzpicture}
\end{center}
\end{document}

Result

robintux
  • 111