Update pages/Transformation.py
Browse files- pages/Transformation.py +54 -0
pages/Transformation.py
CHANGED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pandas as pd
|
3 |
+
|
4 |
+
st.subheader(":red[**Transformation**]")
|
5 |
+
st.write("**What is Transformation?**")
|
6 |
+
st.write("""
|
7 |
+
a transformation refers to the operation of changing the position, size, orientation, or shape of a geometric object while maintaining some of its properties. Common types of transformations include:
|
8 |
+
|
9 |
+
- Translation (shifting an object).
|
10 |
+
- Rotation (turning an object).
|
11 |
+
- Scaling (resizing an object).
|
12 |
+
- Reflection (flipping an object across a line).
|
13 |
+
- Shearing (slanting an object).
|
14 |
+
""")
|
15 |
+
|
16 |
+
st.write("**What is an Affine Transformation?**")
|
17 |
+
st.write("""
|
18 |
+
An affine transformation is a specific type of transformation that preserves:
|
19 |
+
|
20 |
+
- Points.
|
21 |
+
- Straight lines.
|
22 |
+
- Parallelism (parallel lines remain parallel after the transformation).
|
23 |
+
|
24 |
+
Affine transformations can include:
|
25 |
+
|
26 |
+
- Translation.
|
27 |
+
- Rotation.
|
28 |
+
- Scaling.
|
29 |
+
-Shearing.
|
30 |
+
|
31 |
+
Affine transformations do not necessarily preserve angles or lengths, but they do maintain the general shape and relative proportions of geometric figures.
|
32 |
+
""")
|
33 |
+
|
34 |
+
st.write("**Mathematical Representation of Affine Transformations**")
|
35 |
+
st.write("Affine transformations can be expressed using matrix multiplication and vector addition:")
|
36 |
+
code="""
|
37 |
+
y=A⋅x+b
|
38 |
+
"""
|
39 |
+
st.code(code,language="python")
|
40 |
+
st.write("""
|
41 |
+
Where:
|
42 |
+
|
43 |
+
𝑥
|
44 |
+
x: Input vector (original point coordinates).
|
45 |
+
|
46 |
+
𝑦
|
47 |
+
y: Output vector (transformed point coordinates).
|
48 |
+
|
49 |
+
𝐴
|
50 |
+
A: Transformation matrix (2x2 for 2D transformations).
|
51 |
+
|
52 |
+
𝑏
|
53 |
+
b: Translation vector.
|
54 |
+
""")
|