Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package fraktal;
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import static java.lang.Math.sqrt;
- import java.text.DecimalFormat;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.Locale;
- import java.util.Random;
- /**
- *
- * @author HP
- */
- public class Fraktal {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) throws IOException {
- // TODO code application logic here
- BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
- int ile, d=0;
- double i = sqrt(-1);
- double rzeczywista,urojona;
- double x;
- String line = br.readLine();
- ile = Integer.parseInt(line.split(" ")[0]);
- while(ile>d)
- {
- line = br.readLine();
- x= Double.parseDouble(line.split(" ")[0]);
- rzeczywista = Math.cos(Math.log(x));
- urojona = Math.sin(Math.log(x));
- rzeczywista *= 100; // pi = pi * 100;
- rzeczywista= Math.round(rzeczywista);
- rzeczywista /= 100;
- urojona *= 100; // pi = pi * 100;
- urojona= Math.round(urojona);
- urojona /= 100;
- System.out.println(rzeczywista + " " + urojona);
- d++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement