Theory
Mirror और Slant
Translate, scale, और rotate से आगे, दो और transformations 2D toolkit को round out करते हैं: reflection (एक shape को mirror करना) और shearing (इसे slant करना)। दोनों, बाकियों की तरह, हर point (x, y) को एक simple rule से transform करते हैं, और दोनों common exam questions हैं।
यह final lesson worked examples के साथ इन्हें cover करता है। Reflection एक coordinate का sign बदलकर या coordinates swap करके एक shape को एक axis या line के across flip करता है; shearing points को इनकी position के proportion में sideways push करता है। Basic तीन के साथ मिलकर, ये आपको standard 2D transformations का पूरा set देते हैं।
Theory
Reflection: एक Shape को Mirror करना
Reflection एक axis या line के across एक mirror image produce करता है। Common cases:
- x-axis के about: (x, y) (x, -y) बनता है, y-coordinate sign flip करता है।
- y-axis के about: (x, y) (-x, y) बनता है, x-coordinate sign flip करता है।
- origin के about: (x, y) (-x, -y) बनता है, दोनों flip होते हैं।
- Line y = x के about: (x, y) (y, x) बनता है, coordinates swap होते हैं।
Example: (2, 3) को x-axis के about reflect करने पर (2, -3) मिलता है, shape axis के नीचे flip होता है। (2, 3) को y = x के about reflect करने पर (3, 2) मिलता है, coordinates swap होते हैं। Reflection बस एक sign change या एक coordinate swap है।
Theory
Shearing: एक Shape को Slant करना
Shearing एक shape slant करता है, एक rectangle को एक parallelogram में बदलते हुए। Points एक direction में इतना shift होते हैं जितना दूसरी direction में इनकी position के proportion में है।
एक x-direction shear points को इनके y (height) के proportion में horizontally push करता है:
x' = x + shx times y, y' = y
Example: (2, 3) को factor 2 के साथ x में shear करने पर x' = 2 + 2 times 3 = 8, y' = 3 मिलता है, तो (2, 3) (8, 3) बनता है, point जितना higher है, यह उतना ही आगे right slide होता है। एक y-direction shear mirror करता है: y' = y + shy times x, x' = x, points को इनके x के proportion में up slide कराते हुए। Shear एक proportional slide है, flip नहीं।
At a glance
| Transformation | Rule | Effect |
|---|---|---|
| x-axis के about Reflect | (x, y) -> (x, -y) | x-axis के नीचे/ऊपर Mirror |
| y-axis के about Reflect | (x, y) -> (-x, y) | y-axis के left/right Mirror |
| y = x के about Reflect | (x, y) -> (y, x) | Coordinates Swap (diagonal के across mirror) |
| x में Shear | x' = x + shx*y, y' = y | y के proportion में horizontally slant |
| y में Shear | y' = y + shy*x, x' = x | x के proportion में vertically slant |
Quiz
Point (2, 3) पर factor 2 का एक x-direction shear apply करने पर, जहाँ x' = x + 2y और y' = y, कौन सा point मिलता है?
- (2, 8), y को shear करते हुए instead
- (8, 3), क्योंकि x' = 2 + 2(3) = 8 और y' = 3
- (2, 3), unchanged
- (2, -3), एक reflection
Show the answer
(8, 3), क्योंकि x' = 2 + 2(3) = 8 और y' = 3
एक x-direction shear x' = x + shx times y और y' = y इस्तेमाल करता है। shx = 2 और point (2, 3) के साथ: x' = 2 + 2(3) = 2 + 6 = 8, और y' = 3, (8, 3) देते हुए। Option A wrong coordinate shear करता है (वह एक y-direction shear होता)। Option C wrong है: shear point को change करता है (x 2 से 8 तक move होता है)। Option D, (2, -3), x-axis के about एक reflection है, shear नहीं। एक x-shear में horizontal position y के proportion में shift होती है (यहाँ 2 times 3 = 6), तो higher points आगे right slide होते हैं।
Think first
Reflection और Shear पिछले Lesson के Matrix Approach से कैसे Fit होते हैं?
Basic transformations matrices बन गए। क्या reflection और shear भी matrices हैं, और यह क्यों matter करता है? फिर tap कीजिए।
Show the answer
हाँ, reflection और shearing भी LINEAR transformations हैं जो matrices की तरह expressible हैं, जिसका मतलब है पूरा 2D toolkit, translate, scale, rotate, reflect, shear, एक uniform matrix framework में रहता है जहाँ transformations multiplication से combine होते हैं। x-axis के about Reflection, उदाहरण के लिए, वह matrix है जो (x, y) को (x, -y) पर map करता है: इसकी rows हैं [1 0][0 -1] (या homogeneous 3x3 form में एक extra [0 0 1] row के साथ)। y=x के about Reflection coordinates swap करता है, matrix rows [0 1][1 0]। Factor shx वाला एक x-shear वह matrix है [1 shx][0 1], (x,y) को (x + shx*y, y) पर mapping करते हुए। क्योंकि इनमें से हर एक एक matrix है (और translation भी, homogeneous coordinates के thanks to), आपको पिछले lesson में describe किया गया वही powerful benefit मिलता है: आप इनकी किसी भी sequence को COMBINE कर सकते हैं, reflect फिर shear फिर rotate फिर translate, इनके matrices को MULTIPLY करके एक single combined matrix में, और फिर वह एक matrix एक shape के हर point पर apply कर सकते हैं। यही वजह है matrix formulation computer graphics के लिए इतना central है: यह geometric operations की एक पूरी varied family को एक consistent operation (matrix multiply) में बदल देता है, आपको simple ones से complex transformations compose करने देता है, और कई points पर इन्हें apply करना fast और uniform बनाता है। तो reflection और shear system के बाहर special cases नहीं हैं; ये उसी matrix machinery में right slot करते हैं, एक clean, unified toolkit complete करते हुए। हर standard 2D transformation एक matrix है, तो ये सब multiplication से compose होते हैं, जो graphics में transformation geometry का elegant heart है।
Theory
BCA601-03 Complete
आपने computer graphics को top से नीचे तक trace किया है: यह किसके लिए इस्तेमाल होता है, displays और files images को कैसे represent करती हैं (raster vs vector), एक line pixel by pixel कैसे compute होती है (DDA और Bresenham), और shapes को transformations से कैसे move किया जाता है (translate, scale, rotate, reflect, shear) matrices और homogeneous coordinates इस्तेमाल करते हुए। यही subject का पूरा arc है। दो algorithm-and-matrix units exam heart हैं, worked examples practise कीजिए जब तक pixels और matrices हर बार सही न आएँ। Well done।
Summary
Key takeaways
- Reflection एक shape को mirror करता है: x-axis के about (x,y)->(x,-y), y-axis के about (x,y)->(-x,y), origin के about (x,y)->(-x,-y), y=x के about (x,y)->(y,x)।
- Worked: (2,3) x-axis के about (2,-3) देता है; (2,3) y=x के about (3,2) देता है।
- Shearing एक shape slant करता है: x-shear x' = x + shxy, y' = y (height के proportion में); y-shear y' = y + shyx, x' = x।
- Worked: (2,3) factor 2 के एक x-shear के साथ (2 + 2*3, 3) = (8,3) देता है।
- Reflection एक sign change या coordinate swap है; shear एक proportional slide है (एक slant, flip नहीं)।
- Reflection और shear भी matrices हैं, तो सारे standard 2D transformations matrix multiplication से combine होते हैं।
- Memory hook: reflection flip करता है (sign change/swap), shear proportionally slant करता है; सारे transformations matrices हैं।