Here you can find the source of drawFleche1(Graphics g, double x, double y, double x1, double y1, int L)
static private void drawFleche1(Graphics g, double x, double y, double x1, double y1, int L)
//package com.java2s; //License from project: Open Source License import java.awt.*; public class Main { static private void drawFleche1(Graphics g, double x, double y, double x1, double y1, int L) { g.drawLine((int) x, (int) y, (int) x1, (int) y1); double theta, delta; if (x != x1) { theta = Math.atan((y1 - y) / (x1 - x)); if (x > x1) theta += Math.PI; } else {/* ww w . jav a 2 s. c o m*/ if (y < y1) theta = Math.PI / 2; else theta = -Math.PI / 2; } delta = 3.0 * Math.PI / 4; double dx1 = L * Math.cos(theta + delta); double dy1 = L * Math.sin(theta + delta); double dx2 = L * Math.cos(theta - delta); double dy2 = L * Math.sin(theta - delta); g.drawLine((int) (x1 + dx1), (int) (y1 + dy1), (int) x1, (int) y1); g.drawLine((int) x1, (int) y1, (int) (x1 + dx2), (int) (y1 + dy2)); } }