2
$\begingroup$

I want to draw a line on the complex plane which begins at $0.4+0.1i$, and with an angle of $\frac{\pi}{4}$ with respect to the real axis. Is there a simple way to do this in Mathematica?

$\endgroup$
  • 2
    $\begingroup$ Plot[ x - 0.3, { x, 0.4, 1 }] $\endgroup$ – Andrey R Mar 7 '16 at 20:59
  • $\begingroup$ In fact I would like to generalize this for every theta and point! but thanks $\endgroup$ – Julien Roussillon Mar 7 '16 at 23:04
5
$\begingroup$

of course! :) ... but I'm going to give you some food for thought

v = 4/10 + 1/10 I;
ParametricPlot[Through[{Re, Im}[v]] + {Cos[Pi/4], Sin[Pi/4]} t, {t, 0, 2}, 
               AxesOrigin -> {0, 0}]

Mathematica graphics

$\endgroup$
  • 2
    $\begingroup$ That sounds really good, thanks a lot for your help! $\endgroup$ – Julien Roussillon Mar 7 '16 at 23:05
  • $\begingroup$ @JulienRoussillon Of course that isn't the easiest way, but you aren't a freshman. So I thought about introducing a few useful tricks.Hope you can follow them $\endgroup$ – Dr. belisarius Mar 7 '16 at 23:11
5
$\begingroup$

Of course, you can also use the new InfiniteLine[] primitive:

Graphics[InfiniteLine[ReIm[0.4 + 0.1 I], ReIm[Exp[I π/4]]]]

An alternative also uses AngleVector[]:

Graphics[InfiniteLine[ReIm[0.4 + 0.1 I], AngleVector[π/4]]]

Generalization should be straightforward.


Here is a visualization courtesy of m_goldberg:

With[{z0 = (4 + 1 I)/10, θ = π/4},
  Graphics[{
    InfiniteLine[ReIm[z0], ReIm[Exp[I θ]]],
    Red, AbsolutePointSize[8], Point[ReIm[z0]]},
    PlotRange -> {{-1, 1}, {-1, 1}},
    Frame -> True]]

line

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.