# Rotate a line

I want to simulate the minute hand of a clock and am doing so by multiplying the other line vertex with the rotation matrix. Is there a simpler way e.g. rotating the actual graphic object symbolically?

Rotate a line

add a comment

0

This is a situation where using polar coordinates can be quite helpful. Hope the code below helps.

```
def sec_to_rad( n ):
theta = 2*n*pi/60
return (sin(theta),cos(theta))
sum([line([(0,0),sec_to_rad(i)],axes=False)+text("{}".format(i),sec_to_rad(i)) for i in range(60)]).show(aspect_ratio=1)
```

To see above in action see here.

Asked: **
2015-10-05 17:28:10 -0600
**

Seen: **262 times**

Last updated: **Oct 05 '15**

How do I save a rational matrix for Mathematica and Matlab to read?

Why GF(256) matrix only have zero and one number?

import csv file: integers appearing as floating points

Polynomial interpolation given a mathematic function f(x), an interval [a,b] and a natural number n

How to calculate sine of a matrix

Does right_kernel_matrix support assumptions over the symbolic ring?

A question on symbolic Matrices - unexpected Decimals in algebraic entry

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.