Skip to content
Snippets Groups Projects
TriangleScrolls.mmt 4.95 KiB
Newer Older
  • Learn to ignore specific revisions
  • ComFreek's avatar
    ComFreek committed
    /T Modular scrolls having to do with triangles ❚
    
    ComFreek's avatar
    ComFreek committed
    namespace http://mathhub.info/FrameIT/frameworld ❚
    
    fixmeta ?FrameworldMeta ❚
    
    /T A blueprint problem theory for triangle scrolls
           B
          /|
         / |
        /  |
       /___|
      A    C
    
      (nicer image: https://en.wikipedia.org/wiki/Right_triangle#/media/File:Rtriangle.svg)
    
    theory TriangleScroll_GeneralProblem =
    
    ComFreek's avatar
    ComFreek committed
        A: point ❘ meta ?MetaAnnotations?label "A" ❙
        B: point ❘ meta ?MetaAnnotations?label "B"❙
        C: point ❘ meta ?MetaAnnotations?label "C"❙
    
    
    
    /T A blueprint problem theory for triangle scrolls that require a right angle
    
       We use ?TriangleScroll_GeneralProblem and demand the angle at C to be 90° ❚
    theory TriangleScroll_RightAngledProblem =
        include ?TriangleScroll_GeneralProblem ❙
        rightAngleBCA
            : ⊦ ( ∠ B,C,A ) ≐ 90.0 ❘
    
    ComFreek's avatar
    ComFreek committed
            meta ?MetaAnnotations?label s"∟${lverb C}" ❘
            meta ?MetaAnnotations?description s"Right angle at ${lverb C}"
    
    
    
    
    theory AngleSum =
    
    ComFreek's avatar
    ComFreek committed
        meta ?MetaAnnotations?problemTheory ?AngleSum/Problem ❙
        meta ?MetaAnnotations?solutionTheory ?AngleSum/Solution ❙
    
    
    ComFreek's avatar
    ComFreek committed
        theory Problem =
    
            include ?TriangleScroll_GeneralProblem ❙
    
    
    ComFreek's avatar
    ComFreek committed
            angleBAC
                : Σ α: ℝ. ⊦ ( ∠ B,A,C ) ≐ α ❘
    
    ComFreek's avatar
    ComFreek committed
                meta ?MetaAnnotations?label s"∠${lverb B A C}" ❘
                meta ?MetaAnnotations?description s"Angle at ${lverb A}"
    
    ComFreek's avatar
    ComFreek committed
            angleABC
    
                : Σ β: ℝ. ⊦ ( ∠ A,B,C ) ≐ β ❘
    
    ComFreek's avatar
    ComFreek committed
                meta ?MetaAnnotations?label s"∠${lverb A B C}" ❘
                meta ?MetaAnnotations?description s"Angle at ${lverb B}"
    
    ComFreek's avatar
    ComFreek committed
        theory Solution =
    
    ComFreek's avatar
    ComFreek committed
            include ?AngleSum/Problem ❙
    
    
    ComFreek's avatar
    ComFreek committed
            meta ?MetaAnnotations?label "AngleSum" ❙
    
    ComFreek's avatar
    ComFreek committed
            meta ?MetaAnnotations?description s"Given a triangle ${lverb A B C} and two known angles, we can deduce the missing angle by the sum of interior angles in triangles always being 180°" ❙
    
    ComFreek's avatar
    ComFreek committed
            angleBCA
    
                : Σ γ: ℝ. ⊦ ( ∠ B,C,A ) ≐ γ ❘
    
    ComFreek's avatar
    ComFreek committed
                = ⟨180.0 - (πl angleBAC) - (πl angleABC), sketch "By sum of interior angles = 180° in triangles"⟩ ❘
    
    ComFreek's avatar
    ComFreek committed
                meta ?MetaAnnotations?label s"∠${lverb B C A}" ❘
                meta ?MetaAnnotations?description s"The deduced angle by calculating 180° - ${lverb angleBAC} - ${lverb angleABC}"
    
    
    
    
    
    theory OppositeLen =
    
    ComFreek's avatar
    ComFreek committed
        meta ?MetaAnnotations?problemTheory ?OppositeLen/Problem ❙
        meta ?MetaAnnotations?solutionTheory ?OppositeLen/Solution ❙
    
    
    ComFreek's avatar
    ComFreek committed
        theory Problem =
    
            include ?TriangleScroll_RightAngledProblem ❙
        
    
    ComFreek's avatar
    ComFreek committed
            distanceBC
    
                : Σ x:ℝ . ⊦ ( d- B C ) ≐ x ❘
    
    ComFreek's avatar
    ComFreek committed
                meta ?MetaAnnotations?label s"${lverb B C}" ❘
                meta ?MetaAnnotations?description s"Length of leg ${lverb B C}"
    
    ComFreek's avatar
    ComFreek committed
            angleABC
    
                : Σ a:ℝ . ⊦ ( ∠ A,B,C ) ≐ a ❘
    
    ComFreek's avatar
    ComFreek committed
                meta ?MetaAnnotations?label s"∠${lverb A B C}" ❘
                meta ?MetaAnnotations?description s"Angle at ${lverb B}"
    
    ComFreek's avatar
    ComFreek committed
        theory Solution =
            include ?OppositeLen/Problem ❙
    
    
    ComFreek's avatar
    ComFreek committed
            meta ?MetaAnnotations?label "OppositeLen" ❙
    
    ComFreek's avatar
    ComFreek committed
            meta ?MetaAnnotations?description s"Given a triangle ${lverb A B C} right angled at ${lverb C}, the distance ${lverb A B} can be computed from the angle at ${lverb B} and the distance ${lverb B C}" ❙
    
        
            deducedLineCA
                : Σ x:ℝ . ⊦ (d- C A) ≐ x ❘
    
    ComFreek's avatar
    ComFreek committed
                = ⟨(tan (πl angleABC)) ⋅ (πl distanceBC), sketch "OppositeLen Scroll"⟩ ❘
    
    ComFreek's avatar
    ComFreek committed
                meta ?MetaAnnotations?label s"${lverb C A}" ❘
                meta ?MetaAnnotations?description s"The deduced length of the line ${lverb C A}"
    
    // Doesn't typecheck, not sure why ❚
    // theory Pythagoras =
    
    ComFreek's avatar
    ComFreek committed
        meta ?MetaAnnotations?problemTheory ?Pythagoras/Problem ❙
        meta ?MetaAnnotations?solutionTheory ?Pythagoras/Solution ❙
    
    
    ComFreek's avatar
    ComFreek committed
        theory Problem =
    
            include ?TriangleScroll_RightAngledProblem ❙
        
    
    ComFreek's avatar
    ComFreek committed
            distanceAC
    
                 : Σ x:ℝ. ⊦ (d- A C) ≐ x ❘
    
    ComFreek's avatar
    ComFreek committed
                 meta ?MetaAnnotations?description "Length of leg AC"
    
    ComFreek's avatar
    ComFreek committed
            distanceBC
    
                 : Σ x:ℝ. ⊦ (d- B C) ≐ x ❘
    
    ComFreek's avatar
    ComFreek committed
                 meta ?MetaAnnotations?description "Length of leg BC"
    
    ComFreek's avatar
    ComFreek committed
        // theory Solution =
    
    ComFreek's avatar
    ComFreek committed
            include ?Pythagoras/Problem ❙
    
    
    ComFreek's avatar
    ComFreek committed
            meta ?MetaAnnotations?label "Pythagoras" ❙
            meta ?MetaAnnotations?description "Given a ABC right-angled at C and lengths of both legs, we can compute the length of the hypotenuse via Pythagora's theorem" ❙
    
    
            deducedHypotenuse
                : Σ x:ℝ. ⊦ (d- A B) ≐ x ❘
    
    ComFreek's avatar
    ComFreek committed
                = ⟨√ ((πl distanceAC) ⋅ (πl distanceAC) + (πl distanceBC) ⋅ (πl distanceBC)),
    
                   sketch "By Pythagora's theorem"⟩ ❘
    
    ComFreek's avatar
    ComFreek committed
                meta ?MetaAnnotations?description "Deduced length of hypotenuse AB"