[pstricks] tangent to \psellipse or \pscircle

Juergen Gilg gilg at acrotex.net
Tue Oct 30 08:22:39 CET 2007


Dear Patrick,

here a more PS-tricky solution

\documentclass{article}
\usepackage{pstricks,pst-plot,pstricks-add}
\begin{document}
\begin{pspicture}(-4.5,-4.5)(4.5,4.5)
\psaxes{->}(0,0)(-4.5,-4.5)(4.5,4.5)
\psplot[algebraic,plotpoints=500]{-4}{4}{(16-x^2)^(0.5)}
\psplot[algebraic,plotpoints=500]{-4}{4}{-(16-x^2)^(0.5)}
\psplotTangent[algebraic,linecolor=blue]{3}{1}{(16-x^2)^(0.5)}
\end{pspicture}

alternative

\begin{pspicture}(-4.5,-4.5)(4.5,4.5)
\psaxes{->}(0,0)(-4.5,-4.5)(4.5,4.5)
\psplot[polarplot,algebraic,plotpoints=500]{0}{TwoPi}{4}
\psplotTangent[polarplot,algebraic,linecolor=blue]{Pi}{1}{4}
\end{pspicture}
\end{document}

Regards,

Juergen

Patrick Drechsler wrote:
> Patrick Drechsler <patrick at pdrechsler.de> writes:
>
>   
>> what is the best way to draw a tangent to \psellipse or \pscircle at
>> certain coordinates? And how does one retreive these coordinates?
>>     
>
> Using pst-eucl solved the problem at hand.
>
> For the record:
>
> --8<---------------cut here---------------start------------->8---
> \documentclass{article}
> \usepackage{pstricks}
> \usepackage{pst-eucl}
> \usepackage{pstricks-add}% needed for \psRelLine
> \SpecialCoor%
> \begin{document}
> \begin{pspicture}[showgrid=true](-3,-3)(2.5,2)
>   %% Circle:
>   \pstGeonode(0,0){O}%
>   \pstGeonode(2,0){A}%
>   \pstCircleOA{O}{A}% draw circle
>   %% Line:
>   \pstGeonode[PosAngle=135](-2,-1.5){W1}%
>   \pstGeonode[PosAngle=135](3,-1.5){W2}%
>   \psline[linewidth=0.5pt,linecolor=gray](W1)(W2)% draw line
>   %% Intersection between line and circle:
>   \pstInterLC[PosAngleA=-90,PosAngleB=-45]{W1}{W2}{O}{A}{SP1}{SP2}
>   %% Secant between the above intersection points SP1 and SP2:
>   \psline[linecolor=blue](SP1)(SP2)
>   %% Draw radius:
>   \psline[linecolor=cyan](O)(SP1)
>   %% Tangent:
>   \psRelLine[linecolor=red,angle=90](SP1)(O){0.5}{EndnodeA}
>   \psRelLine[linecolor=red,angle=-90](SP1)(O){0.5}{EndnodeB}
>   \rput([offset=-.3]EndnodeB){{\color{red}tangent}}
> \end{pspicture}
> \end{document}
> --8<---------------cut here---------------end--------------->8---
>
> There are probably more elegant ways of doing this.
>
> Cheers,
>
> Patrick 
>   

-- 
  jürgen gilg
  austr. 59
  70376 stuttgart

tel       0711-59 27 88
e-mail    gilg at acrotex.net
website   www.acrotex.net
          www.gilligan-online.de
          www.brueckenkurs-physik.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20071030/05f658e3/attachment.html 


More information about the PSTricks mailing list