question archive Geometric shapes can be scaled up or down in size
Subject:Computer SciencePrice:2.89 Bought3
Geometric shapes can be scaled up or down in size. For example, scaling by a factor of 3 triples the size of a shape, whereas scaling by a factor of 0.5 reduces the size of a shape by one-half. Write a method scale that expects a parameter of type double and scales a circle by that factor.
Scale factor is just a number that increases the measurements of a shape. This can make a shape bigger. Bigger shapes will have a scale component more noteworthy than one. Along these lines, if the scale element is three, then the measurements of the new shape will be three times bigger than that of the first.
Suppose you claim a donut shop and you need a monster strawberry-iced donut on top of your shop. You may utilize a scale variable of 25. Each heavenly creep of a normal donut would be 25 inches on the model. Thus, a 5-inch donut would be 125 inches, or just about 10.5 feet tall.
A scale element can likewise make a shape littler. Littler shapes will have a scale element of short of what one. You've most likely seen this with Matchbox autos, which are regularly contracted down forms of genuine autos. This additionally works with dollhouses. For instance, a model of a house may have a scale component of 1/50. That implies that 1 inch on the model is equivalent to 50 inches on the real house. In this way, a 4-foot-tall dresser would be around 1 inch tall in the model.