(* 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, Map(Reverse(#) &, Drop(Reverse(pB), 1))); pE = Join(pE, Map(Reverse(#) &, Drop(Reverse(pE), 1))); (* rotation matrix for 90 degrees *) A = {{-1., 0.}, {0., 1.}}; (* rotation matrix for 180 degrees *) B = {{-1., 0.}, {0., -1.}}; pB = Join(pB, Map(#.A &, Drop(Reverse(pB), 1))); pE = Join(pE, Map(#.A &, Drop(Reverse(pE), 1))); pB = Join(pB, Map(#.B &, Drop(Drop(pB, 1), -1))); pE = Join(pE, Map(#.B &, Drop(Drop(pE, 1), -1))); (* 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} )