# Path: batma/maths/mathematic.py
# def inversesqrt(value):
# def mod(a, b):
# def sign(value):
# def step(value, threshold):
# def clamp(value, min_value, max_value):
# def wrap_angle(angle):
# def distance(value1, value2):


import pygame
import batma
from batma.maths import mathematic as math
from OpenGL import GL as gl
    gl.glLineWidth(width)
    gl.glColor4fv(color)
    
    gl.glBegin(gl.GL_LINE_LOOP if closed else gl.GL_LINE_STRIP)
    for position in points:
        gl.glVertex2f(*position)
    gl.glEnd()
    
    gl.glEnable(gl.GL_TEXTURE_2D)

def polygon(points, color=None, width=0):
    color = color or batma.display.default_color
    gl.glDisable(gl.GL_TEXTURE_2D)

    gl.glLineWidth(width or 1)
    gl.glColor4fv(color)
    
    gl.glBegin(gl.GL_POLYGON if width==0 else gl.GL_LINE_LOOP)
    for position in points:
        gl.glVertex2f(*position)
    gl.glEnd()
    
    gl.glEnable(gl.GL_TEXTURE_2D)

def circle(center, radius, color=None, width=0):
    points = []
    x, y = center
    angle, step = 0, math.pi/18

    while angle < 2*math.pi:

# Path: batma/maths/mathematic.py
# def inversesqrt(value):
# def mod(a, b):
# def sign(value):
# def step(value, threshold):
# def clamp(value, min_value, max_value):
# def wrap_angle(angle):
# def distance(value1, value2):


# Path: batma/graphics/draw.py
import pygame
import batma
from batma.maths import mathematic as math
from OpenGL import GL as gl

    gl.glLineWidth(width)
    gl.glColor4fv(color)
    
    gl.glBegin(gl.GL_LINE_LOOP if closed else gl.GL_LINE_STRIP)
    for position in points:
        gl.glVertex2f(*position)
    gl.glEnd()
    
    gl.glEnable(gl.GL_TEXTURE_2D)

def polygon(points, color=None, width=0):
    color = color or batma.display.default_color
    gl.glDisable(gl.GL_TEXTURE_2D)

    gl.glLineWidth(width or 1)
    gl.glColor4fv(color)
    
    gl.glBegin(gl.GL_POLYGON if width==0 else gl.GL_LINE_LOOP)
    for position in points:
        gl.glVertex2f(*position)
    gl.glEnd()
    
    gl.glEnable(gl.GL_TEXTURE_2D)

def circle(center, radius, color=None, width=0):
    points = []
    x, y = center
    angle, step = 0, math.pi/18

    while angle < 2*math.pi:

        dx, dy = (radius*math.sin(angle), radius*math.cos(angle))