n class="number">0.5</span>
    y1 = centerY + Math.sin(angle) * length * <span class="number">0.5</span>

    x2 = centerX - Math.cos(angle) * length * <span class="number">0.5</span>
    y2 = centerY - Math.sin(angle) * length * <span class="number">0.5</span>

    context = cnv.getContext(<span class="string">"2d"</span>)
    gradient = context.createLinearGradient(x1, y1, x2, y2)
    <span class="keyword">if</span> <span class="keyword">not</span> mirrored
      gradient.addColorStop(<span class="number