4

Consider the code

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=3.0]
  \def\rS{1.3}      % Radius of Sun
  \shade[%
    top color=yellow!70,%
    bottom color=orange!50,%
    shading angle={45},%
  ](0, 0) circle (\rS);
\end{tikzpicture}
\end{document}

which produces the following image of the Sun

enter image description here

The following picture I have extracted from https://solarsystem.nasa.gov/solar-system/sun/overview/

enter image description here

QUESTION: How may I make the tikz Sun resemble a little more the intensity and aura of the NASA image?

Thank you.

1 Answer 1

11

Someone will probably come up with a better answer as I think this doesn't really work with variable sized suns. But the effect is not too bad:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadows}
\pgfdeclareradialshading{sunfading}{\pgfpointorigin}{
  color(0pt)=(pgftransparent!100); color(15bp)=(pgftransparent!90);
  color(20bp)=(pgftransparent!20);
  color(25bp)=(pgftransparent!100); color(50bp)=(pgftransparent!100)}%
\pgfdeclarefading{sun fading}{\pgfuseshading{sunfading}}%
\begin{document}
\begin{tikzpicture}[scale=3.0]
  \def\rS{1.3}      % Radius of Sun
  \fill[black] (-1.7,-1.7) rectangle (1.7,1.7);
  \shade[%
    top color=yellow!70,%
    bottom color=orange!50,%
    shading angle={45},%
  ](0, 0) circle (\rS);
  \path[circular drop shadow={%
      shadow scale=1.2, shadow xshift=0pt, shadow yshift=0pt,
      fill=yellow, path fading=sun fading,
      every shadow,
  }] (0, 0) circle (\rS);
\end{tikzpicture}
\end{document}

output

1
  • Many thanks for this fine answer.
    – DDS
    Dec 28, 2022 at 18:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .