// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) space 
// Source File Name:   Sin.java

package lt.ktu.gmj.tasks;

import lt.ktu.gmj.*;
import lt.ktu.gmj.propertySheet.*;

// Referenced classes of package lt.ktu.gmj.tasks:
//            SinDomain

public class Sin extends AbstractTask
    implements TaskWithAnalyzers
{

    public Sin()
    {
        domain = new SinDomain();
        multiplier = 1.0D;
        function = 1;
    }

    public Class[] analyzers()
        throws ClassNotFoundException
    {
        Class class1 = Class.forName("lt.ktu.gmj.analysis.Spectrum");
        return (new Class[] {
            class1
        });
    }

    public void customize(PropertyManager propertymanager)
    {
        String as[] = {
            "sin", "cos"
        };
        propertymanager.add(new DoubleProperty("Multiplier", new FieldProvider(this, "multiplier"), 0.10000000000000001D, 1000D));
        propertymanager.add(new ChoiceProperty("Function", new FieldProvider(this, "function"), as));
    }

    public Domain domain()
    {
        return domain;
    }

    public double f(Point point)
    {
        return function == 0 ? Math.sin(point.x[0] * point.x[0] + point.x[1] * point.x[1]) * multiplier : Math.cos(point.x[0] * point.x[0] + point.x[1] * point.x[1]) * multiplier;
    }

    private SinDomain domain;
    public double multiplier;
    public int function;
}
