% hecadd.tex
%
% Addition of Divisor classes represented by D1 = (P1) + (P2) and D2 = (Q1) + (Q2) giving D3 = (R1) + (R2)
% on the hyperelliptic curve C: y^2 = 0.420448207687874 * (x + 2)(x + 0.5)(x - 0.5)(x - 3)(x - 4) 
%
% Author: Peter Schwabe, based on code by Tanja Lange
% Public domain

\psset{linewidth=.7pt,dotsize=1.5pt}
\begin{pspicture}*(-3,-6)(7,6) 
\psaxes{->}(0,0)(-3,-6)(7,6)  

\psplot[plotstyle=curve]{-2}{-0.5}{x x mul x mul x mul x mul 5 x mul x mul x mul x mul sub 2.25 x mul x mul x mul sub 25.25 x mul x mul add 0.5 x
mul add 6 sub sqrt neg 0.176776695347946 mul}
\psplot[plotstyle=curve]{0.5}{3}{x x mul x mul x mul x mul 5 x mul x mul x mul x mul sub 2.25 x mul x mul x mul sub 25.25 x mul x mul add 0.5 x mul
add 6 sub sqrt  neg 0.176776695347946 mul}
\psplot[plotstyle=curve]{4}{7}{x x mul x mul x mul x mul 5 x mul x mul x mul x mul sub 2.25 x mul x mul x mul sub 25.25 x mul x mul add 0.5 x mul
add 6 sub sqrt neg 0.176776695347946 mul}


\psplot[plotstyle=curve]{-2}{-0.5}{x x mul x mul x mul x mul 5 x mul x mul x mul x mul sub 2.25 x mul x mul x mul sub 25.25 x mul x mul add 0.5 x
mul add 6 sub sqrt 0.176776695347946 mul}
\psplot[plotstyle=curve]{0.5}{3}{x x mul x mul x mul x mul 5 x mul x mul x mul x mul sub 2.25 x mul x mul x mul sub 25.25 x mul x mul add 0.5 x mul
add 6 sub sqrt 0.176776695347946 mul}
\psplot[plotstyle=curve]{4}{7}{x x mul x mul x mul x mul 5 x mul x mul x mul x mul sub 2.25 x mul x mul x mul sub 25.25 x mul x mul add 0.5 x mul
add 6 sub sqrt 0.176776695347946 mul}


\rput(-1.8667018079,-.6402405721){{\color{red} $\bullet$}}
\uput[ul](-1.8667018079,-.8202405721){\scriptsize\ $P_1$}

\rput(-1.1063253687999999,.7552057286){{\color{red} $\bullet$}}
\uput[ul](-1.106325368799,.7552057286){\scriptsize\ $P_2$}

\rput(4.034787237,-.3298766653){{\color{green} $\bullet$}}
\uput[l](4.034787237,-.3298766653){\scriptsize\ $Q_1$}

\rput(5.600036693999,5.544219800){{\color{green} $\bullet$}}
\uput[dl](5.600036693999,5.544219800){\scriptsize\ $Q_2$}

\psplot[plotstyle=curve,linecolor=red]{-2.4}{6}{x x mul x mul 0.1250000004 mul x x mul 0.4750000012 mul sub 0.4500000035 x mul sub 1.007999999 add}

\rput(0.7567006271,.4496621478){\color{blue} {$\bullet$}}
\rput(2.1815026179,-.9364704358){\color{blue} {$\bullet$}}

\psline[linestyle=dashed,dash=5pt 5pt](2.1815026179,-6)(2.1815026179,6)
\psline[linestyle=dashed,dash=5pt 5pt](0.7567006271,-6)(0.7567006271,6)

\rput(0.7567006271,-.4496621478){$\bullet$}\uput[dl](0.7567006271,-.4496621478){\scriptsize\ $R_1$}
\rput(2.1815026179,.9364704358){$\bullet$}\uput[ur](2.1815026179,.9364704358){\scriptsize\  $R_2$}

\end{pspicture}
	
