Atelier des rouesLab FR
Objects/Documentation

secteurs32.py

Direction sectors at four vertices · secteurs32.py

Download ↓
"""Exact local direction cones from tight primal slacks of dual-optimal bases."""
from fractions import Fraction as F
from functools import cmp_to_key
from math import gcd,lcm
from itertools import combinations
from voisins30 import ray
from faces25 import constraints,load,table
from deficience21 import solve_square
import json
def direction(a,b):
    d=lcm(a.denominator,b.denominator);x,y=int(a*d),int(b*d);g=gcd(x,y)
    return (x//g,y//g)
def angle(a,b):
    upper=lambda h:h[1]>0 or (h[1]==0 and h[0]>0)
    if upper(a)!=upper(b):return -1 if upper(a) else 1
    c=a[0]*b[1]-a[1]*b[0];return -1 if c>0 else int(c<0)

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.