Calculate the point halfway between current and target

Assignment Help C/C++ Programming
Reference no: EM131609949

Question: A Sierpinski Gasket or Triangle is a type of fractal named after the Polish mathematician Waclaw Sierpinski who described some of its interesting properties in 1916. It is a nice example of how an orderly structure can be created as a result of random, chaotic behavior.

One way to create the fractal is to start with an equilateral triangle. Let us say that the corners are labeled X, Y, and Z.

1. Set current equal to point X.

2. Repeat many times (you can try 10000).

a. Randomly pick target as one of the three X, Y, or Z.

b. Calculate the point halfway between current and target.

c. Set current to this halfway point. d. Draw a pixel at location current. One way to do this is to fill or draw a tiny rectangle at this coordinate.

Write a program that draws a Sierpinski Gasket. You can pick the coordinates for the corners of the triangle. It may seem like you should get a random mess of dots but instead you get a very orderly picture!

To draw a single pixel at coordinate (X,Y), use the draw Line method where the start and endpoints are both (X,Y).

Reference no: EM131609949

Questions Cloud

Working on using microsoft excel : Describe one (1) task you could begin working on using Microsoft Excel and/or Google Sheets (in your current job, in this class or another Strayer course
What is firm weighted average cost of capital : What is the firm's weighted average cost of capital if its debt-equity ratio is 0.71 and the tax rate is 32 percent?
Analyze various leadership theories : Analyze various leadership theories and approaches for their ability to enhance organizational effectiveness to improve sustainability
Discuss reporter shield laws as relate to confidentiality : Describe three types of speeches which are not protected under the First Amendment. Discuss reporter shield laws as they relate to confidentiality.
Calculate the point halfway between current and target : A Sierpinski Gasket or Triangle is a type of fractal named after the Polish mathematician Waclaw Sierpinski who described some of its interesting properties.
What effects do expected salvage value- economic life : What effects do expected salvage value and estimated economic life have on the calculated depreciation deduction?
Promoting smoking directly : What if the site just displayed sports scores without promoting smoking directly?
Qualitative designs for discussion : Differentiate among the following qualitative designs for your discussion. Make sure you include citations from/or referring to authors.
Find the annual discount factor v such that present value : Find the annual discount factor v such that the present value of this perpetuity is 1.6593

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd