Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java 2D An equilateral triangle can be constructed by rotating one vertex of its vertices around its centroid by 120 and 240 degrees. a. Can

Java 2D

An equilateral triangle can be constructed by rotating one vertex of its vertices around its centroid by 120 and 240 degrees.

a. Can you use the mentioned fact to define a function that draw an equilateral triangle given its centroid and one vertex? If so, write the code for this function.

b. Please use the function in a) to construct a sample triangle.

c. use suitable scaling and reflection to reflect the triangle with respect to each of its vertices while it is scaled down by 0.5.

The output may be similar to the below shape

d. use suitable texture to fill the center triangle and use another texture image to fill the small triangles.

e. write java code segment to form single shape from the above 4 triangles then apply rotation transformation to rotate that single shape around the centroid point of the triangle.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Programming questions