test-1.ss 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. (define R2-rect-chi (chart R2-rect))
  2. (define R2-rect-chi-inverse (point R2-rect))
  3. (define R2-polar-chi (chart R2-polar))
  4. (define R2-polar-chi-inverse (point R2-polar))
  5. (define R2-rect-point (R2-rect-chi-inverse (up 'x0 'y0)))
  6. (define R2-polar-point (R2-polar-chi-inverse (up 'r0 'theta0)))
  7. ((compose R2-polar-chi R2-rect-chi-inverse)
  8. (up 'x0 'y0))
  9. (define-coordinates (up x y) R2-rect)
  10. (define-coordinates (up r theta) R2-polar)
  11. (x R2-rect-point)
  12. (r R2-polar-point)
  13. (theta R2-rect-point)
  14. (coordinate-system->vector-basis R2-rect)
  15. (define R2->R (-> (UP Real Real) Real))
  16. ;; (define v
  17. ;; (components->vector-field
  18. ;; (up (literal-function 'b^0 R2->R)
  19. ;; (literal-function 'b^1 R2->R))
  20. ;; R2-rect))
  21. (define v (literal-vector-field 'b R2-rect))
  22. (define omega (literal-1form-field 'a R2-rect))
  23. ((v (literal-manifold-function 'f-rect R2-rect)) R2-rect-point)
  24. (((coordinatize v R2-rect) (literal-function 'f-rect R2->R))
  25. (up 'x0 'y0))
  26. ((v (chart R2-rect)) R2-rect-point)
  27. ((d/dx (square r)) R2-rect-point)
  28. (define circular (- (* x d/dy) (* y d/dx)))
  29. (series:for-each print-expression
  30. (((exp (* 't circular)) (chart R2-rect))
  31. ((point R2-rect) (up 1 0)))
  32. 6)
  33. (g:apply
  34. ((d (literal-manifold-function 'f-rect R2-rect))
  35. (coordinate-system->vector-basis R2-rect))
  36. (list R2-rect-point))
  37. ;;; Try to implement 'use-value' -> fails :-(
  38. ;; (define (inapplicable-object-condition? c)
  39. ;; (if (and (assertion-violation? c)
  40. ;; (string=? "attempt to apply non-procedure ~s"
  41. ;; (condition-message c))
  42. ;; (continuation-condition? c))
  43. ;; (condition-continuation c)
  44. ;; #f))
  45. ;; ;; missing a way to get to the arguments.
  46. ;; (guard (c
  47. ;; ((inapplicable-object-condition? c)
  48. ;; ((condition-continuation c)
  49. ;; (lambda args (g:apply (car (condition-irritants c)) args))))
  50. ;; (else (raise c)))
  51. ;; (((d (literal-manifold-function 'f-rect R2-rect))
  52. ;; (coordinate-system->vector-basis R2-rect))
  53. ;; R2-rect-point))