(* draw angle tick-marks around a square *) (* Half-width of square *) (* x-values for end points *) size = 50.; (* Trigonometry table *) tanTable = Table(Tan(h Degree), {h, 0, 45}); (* x-values for begin points *) lx = Table(size - 6. + Sign(Mod(h, 5)) * 2. + Sign(Mod(h, 10)) * 2., {h, 0, Length(tanTable) - 1}); (* begin points, 0..45 *) pB = MapThread({#1, #2 * #1} &, {lx, tanTable}); (* end points, 0..45 *) pE = Map({size, size * #} &, tanTable); (* 0..45, 46..90 *) pB = Join(pB, ReplaceAll(Drop(Reverse(pB), 1), {x_, y_} :> {y, x})); pE = Join(pE, ReplaceAll(Drop(Reverse(pE), 1), {x_, y_} :> {y, x})); (* 0..90, 91..180 *) pB = Join(pB, ReplaceAll(Drop(pB, 1), {x_, y_} :> {-y, x})); pE = Join(pE, ReplaceAll(Drop(pE, 1), {x_, y_} :> {-y, x})); (* 0..180, 181..359 *) pB = Join(pB, ReplaceAll(Drop(Drop(pB, 1), -1), {x_, y_} :> {-x, -y})); pE = Join(pE, ReplaceAll(Drop(Drop(pE, 1), -1), {x_, y_} :> {-x, -y})); (* interleave begin- and end- points, 0..359 *) (* element contains a line *) g = Map(Line, Partition(Riffle(pB, pE), 2)); Clear(pB, pE); Graphics({Black, Rectangle({-size, -size}, {size, size}), Green, g, Red, Text("+")}, PlotRange -> {-1.1 * size, 1.1 * size} )