Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.graphics.Path;

public class Main {
    private static void arcLineTo(Path pathForTurn, double angle, float cx, float cy, float radius) {
        pathForTurn.lineTo(getProjX(angle, cx, cy, radius), getProjY(angle, cx, cy, radius));
    }

    private static float getProjX(double angle, float cx, float cy, double radius) {
        return getX(angle, radius) + cx;
    }

    private static float getProjY(double angle, float cx, float cy, double radius) {
        return getY(angle, radius) + cy;
    }

    private static float getX(double angle, double radius) {
        return (float) (Math.cos(angle + Math.PI / 2) * radius);
    }

    private static float getY(double angle, double radius) {
        return (float) (Math.sin(angle + Math.PI / 2) * radius);
    }
}