Coloring between an ellipse and a line

In summary, the conversation is about shading or coloring from a line to the border of an ellipse in TikZ. The conversation mentions that the radius of an ellipse changes, making it difficult to use the \filldraw command. The solution is to simply draw the arc with the desired colors. An example code is also provided.
  • #1
Dustinsfl
2,281
5
I drew an ellipse and then bisected it with a line with the basic \draw.
How can I color/shade from the line to the ellipse boarder? We can't use
Code:
\filldraw () -- () arc ( : : radius)
since the radius of an ellipse changes.
 
Physics news on Phys.org
  • #2
Here is my code (which doesn't compile):<code>\documentclass[12pt]{article}\usepackage{tikz}\begin{document}\begin{tikzpicture}[scale=1] \draw (0,0) ellipse [x radius = 3cm, y radius = 2cm]; \draw (0,0) -- (0,4); \filldraw[bottom color = blue!50, top color = red!50] (0,2) arc (0:180 : {(3+2)/2});\end{tikzpicture}\end{document}</code>A:Just draw the arc.<code>\documentclass[12pt]{article}\usepackage{tikz}\begin{document}\begin{tikzpicture}[scale=1] \draw (0,0) ellipse [x radius = 3cm, y radius = 2cm]; \draw (0,0) -- (0,4); \draw[bottom color = blue!50, top color = red!50] (0,2) arc (0:180 : {(3+2)/2});\end{tikzpicture}\end{document}</code>
 

FAQ: Coloring between an ellipse and a line

What is the difference between an ellipse and a line?

An ellipse is a curved shape that is defined by two points called foci and has a constant sum of distances from any point on the ellipse to the two foci. A line is a straight path that extends infinitely in both directions.

How can I color between an ellipse and a line?

To color between an ellipse and a line, you can use a software program or hand-drawn techniques. In a software program, you can use a shape tool to draw an ellipse and a line tool to draw a line, and then use a fill tool to color the area in between.

What is the purpose of coloring between an ellipse and a line?

Coloring between an ellipse and a line can be used in various art and design projects. It can add depth and dimension to an image and create interesting visual effects. It can also be used to represent mathematical concepts or data in a visually appealing way.

Can I color between an ellipse and a line with multiple colors?

Yes, you can color between an ellipse and a line with multiple colors. You can use a gradient or pattern fill to create a smooth transition between colors, or you can manually color different sections with different colors.

Is it possible to change the color between an ellipse and a line after it has been drawn?

Yes, it is possible to change the color between an ellipse and a line after it has been drawn. In a software program, you can select the area and change the fill color. If it was hand-drawn, you can use different coloring materials to change the color.

Similar threads

Replies
6
Views
2K
Replies
9
Views
1K
Replies
11
Views
2K
Replies
1
Views
893
Replies
1
Views
2K
Back
Top