C program 2d transformation triangle


















Apply the translation with the distance 1 towards X axis, 1 towards Y axis and 2 towards Z axis and obtain the new coordinates of the object. Given a circle C with radius 10 and center coordinates 1, 4. Apply the translation with distance 5 towards X axis and 1 towards Y axis. Obtain the new coordinates of C without changing its radius. Given a square with coordinate points A 0, 3 , B 3, 3 , C 3, 0 , D 0, 0. Apply the translation with distance 1 towards X axis and 1 towards Y axis.

Steps of the aforementioned technique :. Skip to content. Change Language. Related Articles. Table of Contents. Improve Article. Save Article. Like Article. Take a step-up from those "Hello World" programs. The scaling factor s x , s y scales the object in X and Y direction respectively. P Scaling process: Note: If the scaling factor S is less than 1, then we reduce the size of the object.

If the scaling factor S is greater than 1, then we increase size of the object. Algorithm: 1. Make a 2x2 scaling matrix S as: S x 0 0 S y 2. For each point of the polygon. Draw the polygon using new coordinates. Below is C implementation:. Next 2D Transformation Rotation of objects. Recommended Articles.



0コメント

  • 1000 / 1000