Zero_to_Hero_Machine_Learning / pages /20.Transformation.py
shwetashweta05's picture
Rename pages/Transformation.py to pages/20.Transformation.py
ac073c9 verified
import streamlit as st
import pandas as pd
st.subheader(":red[**Transformation**]")
st.write("**What is Transformation?**")
st.write("""
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:
- Translation (shifting an object).
- Rotation (turning an object).
- Scaling (resizing an object).
- Reflection (flipping an object across a line).
- Shearing (slanting an object).
""")
st.write("**What is an Affine Transformation?**")
st.write("""
An affine transformation is a specific type of transformation that preserves:
- Points.
- Straight lines.
- Parallelism (parallel lines remain parallel after the transformation).
Affine transformations can include:
- Translation.
- Rotation.
- Scaling.
-Shearing.
Affine transformations do not necessarily preserve angles or lengths, but they do maintain the general shape and relative proportions of geometric figures.
""")
st.write("**Mathematical Representation of Affine Transformations**")
st.write("Affine transformations can be expressed using matrix multiplication and vector addition:")
code="""
y=A⋅x+b
"""
st.code(code,language="python")
st.write("""
Where:
x: Input vector (original point coordinates).
y: Output vector (transformed point coordinates).
A: Transformation matrix (2x2 for 2D transformations).
b: Translation vector.
""")