# How to draw a “Y” shaped branch in Mathematica?

I want to draw a Y-shaped branch in Mathematica. I am trying to draw a line of length L. In step II, I want to translate to the ending point of the line. Then I want to rotate at an angle of 45 deg to the right and draw a line of length L*0.66. Then translate back to the ending point of the first line and draw a line to the left by rotating left at an angle of 45deg. I have tried four several hours but got no success. Below is the code which I have tried:

    L = 100;
Graphics[
line = Line[{{0, 0}, {0, -L}}];
Translate[line, {L/2, L}],
line = Line[{{0, 0}, {0, - L*0.66}}];
Rotate[line, -30 Degree]
]

• The variable p is undefined. And after Graphics, you want the graphics elements to be enclosed in a List or {..} – Michael E2 Sep 2 '18 at 0:48
• Graphics[{Line[{{{0, 0}, {0, -1}}, {{0, 0}, {1/2, 1}}, {{0, 0}, {-1/2, 1}}}]}]? – Michael E2 Sep 2 '18 at 1:05

## 1 Answer

You can use Rotate, Translate and Scale:

line = Line[{{0, 0}, {0, -L}}];
Graphics[{line,
Scale[#, 2/3, {0, 0}] & /@
(Rotate[Translate[line, {0, L}], # Degree, {0, 0}] & /@ {-30, 30})}] • Thank you so much. – BiSarfraz Sep 2 '18 at 1:36