0

Hello.

I'm currently have a task to make but i can't complete it because of my weak knowledge.
I need to draw half of sin parabola with straight lines .
Like this http://www.mif.vu.lt/matinf/asm/vs/pask/java_pr/uzd/7.jpg
It gives me a headache because i really don't like JAVA (I think it's not for me) but i need to do to get positive mark from it :D
thanks in advance for the answer.
What i need. How to make that those lines would end within the parabola top, because I can make that lines would end within parabole. They're all the same lenght

Edited by lithuanian: n/a

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by lithuanian
0

I have tried to make something, but final result doesn't look very good

import java.awt.*;
import java.applet.*;


public class Kazkband extends Applet {

    public void init() {}

    public void paint(Graphics g) {
        g.translate(110,10);
        int j=-100; 
        int i=-10;
        int v;
        while(j<=100) {
        v=i*i;
        g.drawString("J",j,v ); 
        j=j+10; i=i+1;}
        int a=-100;
        g.setColor(Color.black);
        for (int b=0;b<20; b++ )
        {
        g.drawLine(a , 0, a, 100);
        a=a+10;}
    }
}

Edited by Dani: Formatting fixed

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.