free software resistance
the cost of computing freedom is eternal vigilance
### tan.py
*original date:* aug 2012
*orginally posted:* sep 2024
all the files from 2012 say theyre from august- i suspect this is the date of a file transfer rather than the date they were created, some may actually be from 2012 though.
experimenting with trig functions is fun.
```
#!/usr/bin/env python
#2006, 2009, 2012
#public domain
import pygame
import random
import time
import math
pygame.init() ; game = pygame.display.set_mode([640, 480])
def cquit():
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
return 1
elif event.type == pygame.QUIT:
return 1
return 0
c = 0
xc = 320
yc = 240
while 1:
for y2 in range(400, 0, -10):
c += .04
for d in range(1, -1, -1):
for event in pygame.event.get():
pass
if pygame.mouse.get_pressed() == (1, 0, 0):
(xc, yc) = pygame.mouse.get_pos()
for a in range(-3140 + int(c * 1000), 3140 + int(c * 1000), 15):
r = 40 + math.tan((a / 1000.0 + c) * 7) * 4
x = int(r * math.cos(a / 1000.0))
y = int(r * math.sin(a / 1000.0))
pygame.draw.circle(game, (0, 0, 127 + 128 * d), (x + xc, y + yc), 5, 0)
r = 40 + math.tan((a / 1000.0 + c) * 7) * 4
x = int(r * math.cos(a / 1000.0))
y = int(r * math.sin(a / 1000.0))
pygame.draw.circle(game, (0, 127 + 128 * d, 127 + 128 * d), (x + xc, y + yc), 3, 0)
pygame.display.update()
time.sleep(.04)
pygame.draw.rect(game, (0, 0, 0), [0, 0, 640, 480])
if cquit():
exit()
while cquit() == 0:
time.sleep(0.001)
pass #wait to close
```
license: 0-clause bsd
```
# 2006, 2009, 2012 mn
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
```
=> https://freesoftwareresistance.neocities.org