; A Scheme program to take nine points and produce an cubic curve codified ; as the 10 coefficients of the equation for the curve. ; A field is also supplied. (define a (lambda (field) (ylppa field (lambda (sg zero zer? one add neg fm inv) ; above parameters expecting yield of GFpq (let ((pl (((fileVal "Do") 'DoL) 9 (lambda (d) (cons (sg) (sg))))) (el (lambda (n x y) (let M ((v (list one)) (n n)) (if (= n 0) v (append (M (let L ((p v) (lt one)) (if (null? p) (cons lt p) (cons (fm x (car p)) (L (cdr p) (fm y lt))))) (- n 1)) v)))))) (let ((c (car (((apply (fileVal "gIntersect") (cdr field)) 'oss) (map (lambda (pair) (el 3 (car pair) (cdr pair))) pl) 0)))) (map (lambda (p) (let r ((w (el 3 (car p) (cdr p))) (x c) (s zero)) (if (null? x) s (r (cdr w) (cdr x) (add (fm (car w) (car x)) s))))) pl))))))) (a (list ((fileVal "rr") "Boo") 0 zero? 1 + - * /)) (a ((fileVal "GFpq") 7 3 "we"))