![brandontru](/avatars/20739.jpg)
brandontru
14.07.2019 •
History
According to wilson what did the united states "demand" to get out of the war?
Solved
Show answers
More tips
- L Leisure and Entertainment Unlocking the Secrets of Winning the Lottery...
- S Style and Beauty Ultimate Guide on How to Care for Suede Shoes...
- S Sport Running: How to Do It Right?...
- F Food and Cooking How to Cook Spaghetti Right – Secrets and Tips...
- P Philosophy Personal attitude towards Confession: how to prepare and undergo the procedure correctly?...
- H Health and Medicine Flu: How to Recognize It by the First Symptoms?...
- F Food and Cooking How to Sober Up Quickly? Important Facts and Tips...
- H Health and Medicine How to Properly Take a Blood Sugar Test?...
- H Health and Medicine Simple and Effective: How to Get Rid of Cracked Heels...
- O Other How to Choose the Best Answer to Your Question on The Grand Question ?...
Answers on questions: History
- H History French and indian war contributed to the american revolution because?...
- H History Which statements describe the renaissance? group a: a period of extraordinary artistic and literary creativity that was inspired by a new interest in the classics from...
- H History What was the incas major weaknesses?...
- H History Wrong answer its not d really mad because just made a 50...
- H History List, in order, the dynasties that held power in france from the 900s ce to the 1300s ce....
- H History When was israel founded, and who founded it?...
- H History How do the climatic conditions of san francisco, california, and wichita, kansas, compare, considering they are at about the same latitude?...
- H History What is one greek playwritter of athens in the golden age?...
- H History The pagan kingdom developed along which river in myanmar...
- H History The lend-lease act was an attempt by the united states to a. stay out of world war i. b. supply iron and oil to japan. c. divide land acquired from the mexican war. d....
Ответ:
(but in general he wanted to make the world safe for democracy )
Ответ:
/ Sierpinski.java
public class Sierpinski {
// method to find the height of an equilateral triangle with side length =
// length
public static double height(double length) {
// formula= length*sqrt(3)/2
double h = (length * Math.sqrt(3)) / 2.0;
return h;
}
// method to draw a filled triangle (pointed downwards) with bottom vertex
// x,y
public static void filledTriangle(double x, double y, double length) {
// finding height
double h = height(length);
// filling triangle as a polygon
// passing x, x-length/2, x+length/2 as x coordinates
// and y, y+h, y+h as y coordinates
StdDraw.filledPolygon(new double[] { x, x - (length / 2.0),
x + (length / 2.0) }, new double[] { y, y + h, y + h });
}
// method to draw an n level sierpinski triangle
public static void sierpinski(int n, double x, double y, double length) {
// checking if n is above 0 (base condition)
if (n > 0) {
// drawing a filled triangle with x, y as bottom coordinate, length
// as side length
filledTriangle(x, y, length);
// drawing the triangle(s) on the top
sierpinski(n - 1, x, y + height(length), length / 2);
// drawing the triangle(s) on the left side
sierpinski(n - 1, x - (length / 2.0), y, length / 2);
// drawing the triangle(s) on the right side
sierpinski(n - 1, x + (length / 2.0), y, length / 2);
}
}
public static void main(String[] args) {
// parsing first command line argument as integer, if you dont provide
// the value while running the program, this program will cause
// exception.
int n = Integer.parseInt(args[0]);
// length of the outline triangle
double length = 1;
// finding height
double h = height(length);
// drawing a triangle (pointed upwards) to represent the outline.
StdDraw.polygon(new double[] { 0, length / 2, length }, new double[] {
0, h, 0 });
// drawing n level sierpinski triangle(s) with length / 2, 0 as x,y
// coordinates and length / 2 as initial side length
sierpinski(n, length / 2, 0, length / 2);
}
}