Input user input for floating point values of two points x0, y0 and x1, yl x0 != y0 and y0 != yl If (x0 > x1) swap value

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Input user input for floating point values of two points x0, y0 and x1, yl x0 != y0 and y0 != yl If (x0 > x1) swap value

Post by answerhappygod »

Input User Input For Floating Point Values Of Two Points X0 Y0 And X1 Yl X0 Y0 And Y0 Yl If X0 X1 Swap Value 1
Input User Input For Floating Point Values Of Two Points X0 Y0 And X1 Yl X0 Y0 And Y0 Yl If X0 X1 Swap Value 1 (49.73 KiB) Viewed 32 times
Input User Input For Floating Point Values Of Two Points X0 Y0 And X1 Yl X0 Y0 And Y0 Yl If X0 X1 Swap Value 2
Input User Input For Floating Point Values Of Two Points X0 Y0 And X1 Yl X0 Y0 And Y0 Yl If X0 X1 Swap Value 2 (50.79 KiB) Viewed 32 times
Input User Input For Floating Point Values Of Two Points X0 Y0 And X1 Yl X0 Y0 And Y0 Yl If X0 X1 Swap Value 3
Input User Input For Floating Point Values Of Two Points X0 Y0 And X1 Yl X0 Y0 And Y0 Yl If X0 X1 Swap Value 3 (26.47 KiB) Viewed 32 times
Input user input for floating point values of two points x0, y0 and x1, yl x0 != y0 and y0 != yl If (x0 > x1) swap values If (y0 > y1) swap values Input user input for a floating point constant cx, cy Input user input for a positive non-zero integer size_x and size_y Input user input for a positive non-zero integer loop_count; must be greater than +nine. Calculate: dx= x1 - x0/size_x; dy=yl-y0/size_y; Then: For each point on the rectangle between (x0, y0) and (x1, y1) using interval dx and dy: (x0+ m*dx, y0 +n*dx); where m is the value [0, size_x) and n [0, size_y). For every point inside the rectangle defined by (x0, y0) to (x1, y1). Calculate x_prime = (x0+m*dx)*(x0+m*dx) - (y0+n*dy)*(y0+n*dy) + cx Calculate y prime = 2*(x0+m*dx)*(y0+n*dy) + cy Loop from [0, loop_count) times calculate: x_prime = (x_prime + m*dx)*(x_prime+m*dx) - (y_prime + n*dy)*(y_prime +n*dy) + cx y prime = 2*(y_prime+m*dx)*(y0+n*dy) + cy For the calculated result of x_prime, y_prime after loop_count iterations generate a bitmap or other image (use any library such as EasyBMP, Pillow, System.Drawing, ImageIO or JDeli etc...).
For each case: Near zero means inside some small value e.g. [-0.001, 0.001] x_prime positive If x_prime is infinity set pixel channel red to 255, If x_prime is not infinity but greater than loop_count set red to 128 If x_prime less than or equal to loop_count set red to 64 If x_prime is near zero set red and blue channels to 0 x_prime negative If x_prime is negative infinity set pixel channel blue to 255, If x_prime is not infinity but less than negative loop_count set blue to 128 If x prime greater than or equal to negative loop_count set blue to 64 If x_prime is near zero set red and blue to 0 y prime positive If y prime is infinity set pixel channel green to 255, If y prime is not infinity but greater than loop_count set green to 200 If y prime less than or equal to loop_count set green to 160 If y prime is near zero set green channel to 0 y prime negative If y prime is negative infinity set pixel channel green to 128, If y prime is not infinity but less than negative loop_count set green to 90 If y prime greater than or equal to negative loop_count set green to 64 If y prime is near zero set green channel to 0 Input a filename and output the resulting bitmap image to that filename.
Q-2: Write a brief summary describing any issues implementing the function. Did you use recursion? Analyze the function and generate a cost function, do not worry too much about constant values, looking for dependencies based on iteration counts. What is the runtime order of your implementation based on your cost function? What do you observe about the resulting image? Try different values of ranges and bitmap sizes e.g. [-1.0,-1.0 to 1.0,1.0] with size [1024 x 1024]. What do you observe about the runtime for changing values of bitmap? Show examples of function output. How would you alter or optimize to improve output and speed?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply