Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

CS 1334 The University of Texas at Dallas Loopy Forests Lab Code

CS 1334 The University of Texas at Dallas Loopy Forests Lab Code

Question Description

I’m working on a javascript exercise and need support to help me study.

Lab Lesson #8 – Loopy For-ests

See Gitbook for supplemental content – using math formula to draw patterns:

https://kdoore.gitbook.io/cs1334/loops-using-math-…

my forest project: https://www.khanacademy.org/computer-programming/l…

1.Spin-off a copy of your forest project from Lab 4, where you wrote 2 functions:
Leaf ( x, y, leafAngle ) //x,y position, leafAngle of each leaf
Tree ( x, y ) //x,y position of each tree

2.Using the copied project, modify your code to generate:
at least 20 trees with at least 100 leaves on each ?tree

– Don’t include more than one call to your tree function or leaf ?function in your code. (instead, use the for-loops to create multiple trees, multiple leaves on each tree)

– Use 2 for-loops to generate multiple copies of each object (1 loop for trees, 1 loop for leaves)

– Use one for-loop to call the Tree function ( 20+ times)

– Within the Tree function, use one ?for-loop to call the Leaf function ?(100+ times)

– See details of math function for Leaf x, y, input parameters below

– Use a constant or random value for the leafAngle parameter

– Do not use draw( ) function ?

3.Use random numbers: (a, b) and mathematical formulas to place the leaves on the trees

  • Generate two random numbers, with min, max as specified below:
    • 0 <= a <= w [w is the size of tree or however big you want] ?
    • 0 <= b <= 360 [ angle ]

Pick a math equation to generate a pattern,?below
Or, create your own pattern

Circle

x = a*sin(b)

y = a*cos(b)

Oval

x = a*sin(b)

y = 2*a*cos(b)

Half-circle

x = a*sin(b/2+90)

y = a*cos(b/2+90)

Triangle

x = a*sin(b)

y = -a

Conifer

x = a*cos(b/2)

y = a*sin(b+90)

Crown

x = a*cos(b/2)

y = -abs(a*sin(b+90))

Butterfly

x = (2*a/w)*((b+45)%90- 45)*sin(b)

y = (2*a/w)*((b+45)%90- 45)*cos(b)

4. Save your code and submit following the lab submission instructions on e-learning

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: School Assignment only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by School Assignment are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. School Assignment is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At School Assignment, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.