<commit_before>(in-package :rtg-math.projection)

(defun perspective (frame-width frame-height near far fov)
  (let* ((aspect-ratio (/ frame-width frame-height))
         (near near )
         (far far )
         (fov fov )
         (range (tan (/ fov 2.0)))
         (left (- (* range aspect-ratio)))
         (right (* range aspect-ratio))
         (bottom (- range))
         (top range))
    (m4:make
     (/ (* near 2) (- right left))   0.0                            0.0                                0.0
     0.0                             (/ (* near 2) (- top bottom))  0.0                                0.0
     0.0                             0.0                            (/ (- (+ far near)) (- far near)) -1.0
     0.0                             0.0                            (/ (* 2.0 far near) (- near far))  0.0)))

(in-package :rtg-math.projection)

(defun perspective (frame-width frame-height near far fov)
  (let* ((aspect-ratio (/ frame-width frame-height))
	 (near near )
	 (far far )
	 (fov fov )
	 (range (tan (/ fov 2.0)))
	 (left (- (* range aspect-ratio)))
	 (right (* range aspect-ratio))
	 (bottom (- range))
	 (top range))
    (m4:make
     (/ (* near 2) (- right left))   0.0                            0.0                                0.0
     0.0                             (/ (* near 2) (- top bottom))  0.0                                0.0
     0.0                             0.0                            (/ (- (+ far near)) (- far near)) -1.0
     0.0                             0.0                            (/ (* 2.0 far near) (- near far))  0.0)))

(defun orthographic (frame-width frame-height near far)
  (let ((left (- (/ frame-width 2.0)))
	(right (/ frame-width 2.0))
	(top (/ frame-height 2.0))
	(bottom (- (/ frame-height 2.0)))
	(near near )
	(far far ))
    (m4:make
     (/ 2 (- right left)) 0.0 0.0 (- (/ (+ right left) (- left right)))
     0.0 (/ 2 (- top bottom)) 0.0 (- (/ (+ top bottom) (- bottom top)))
     0.0 0.0 (- (/ (- far near))) (- (/ (+ far near) (- far near)))
     0.0 0.0 0.0 1.0)))
<commit_msg>remove duplicate perspective :p<commit_after>(in-package :rtg-math.projection)

(defun perspective (frame-width frame-height near far fov)
  (let* ((aspect-ratio (/ frame-width frame-height))
         (near near )
         (far far )
         (fov fov )
         (range (tan (/ fov 2.0)))
         (left (- (* range aspect-ratio)))
         (right (* range aspect-ratio))
         (bottom (- range))
         (top range))
    (m4:make
     (/ (* near 2) (- right left))   0.0                            0.0                                0.0
     0.0                             (/ (* near 2) (- top bottom))  0.0                                0.0
     0.0                             0.0                            (/ (- (+ far near)) (- far near)) -1.0
     0.0                             0.0                            (/ (* 2.0 far near) (- near far))  0.0)))

(defun orthographic (frame-width frame-height near far)
  (let ((left (- (/ frame-width 2.0)))
	(right (/ frame-width 2.0))
	(top (/ frame-height 2.0))
	(bottom (- (/ frame-height 2.0)))
	(near near )
	(far far ))
    (m4:make
     (/ 2 (- right left)) 0.0 0.0 (- (/ (+ right left) (- left right)))
     0.0 (/ 2 (- top bottom)) 0.0 (- (/ (+ top bottom) (- bottom top)))
     0.0 0.0 (- (/ (- far near))) (- (/ (+ far near) (- far near)))
     0.0 0.0 0.0 1.0)))
{'fraction_non_alphanumeric': 0.17434693278544175, 'fraction_numerical': 0.045494570002935136, 'mean_word_length': 1.1076066790352506, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4284564', 'n_tokens_mistral': 1137, 'n_tokens_neox': 1047, 'n_words': 300}