Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,14 @@
|
|||
#lang racket/base
|
||||
(require racket/list)
|
||||
|
||||
(struct cell (v x z) #:transparent)
|
||||
|
||||
(define (cell-add cx cy)
|
||||
(cell (+ (cell-v cx) (cell-v cy))
|
||||
(+ (cell-x cx) (cell-x cy))
|
||||
(+ (cell-z cx) (cell-z cy))))
|
||||
|
||||
(define (cell-sub cx cy)
|
||||
(cell (- (cell-v cx) (cell-v cy))
|
||||
(- (cell-x cx) (cell-x cy))
|
||||
(- (cell-z cx) (cell-z cy))))
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
(define (row-above row) (map cell-add (drop row 1) (drop-right row 1)))
|
||||
|
||||
(define row0 (list (cell 0 1 0) (cell 11 0 0) (cell 0 1 1) (cell 4 0 0) (cell 0 0 1)))
|
||||
(define row1 (row-above row0))
|
||||
(define row2 (row-above row1))
|
||||
(define row3 (row-above row2))
|
||||
(define row4 (row-above row3))
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
(define eqn40 (cell-sub (car row4) (cell 151 0 0)))
|
||||
(define eqn20 (cell-sub (car row2) (cell 40 0 0)))
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
(define (det2 eqnx eqny get-one get-oth)
|
||||
(- (* (get-one eqnx) (get-oth eqny)) (* (get-one eqny) (get-oth eqnx))))
|
||||
|
||||
(define (cramer2 eqnx eqny get-val get-unk get-oth)
|
||||
(/ (det2 eqnx eqny get-val get-oth)
|
||||
(det2 eqnx eqny get-unk get-oth)))
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
(define x (- (cramer2 eqn20 eqn40 cell-v cell-x cell-z)))
|
||||
(define z (- (cramer2 eqn20 eqn40 cell-v cell-z cell-x)))
|
||||
|
||||
(displayln (list "X" x))
|
||||
(displayln (list "Y" (+ x z)))
|
||||
(displayln (list "Z" z))
|
||||
Loading…
Add table
Add a link
Reference in a new issue