GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Java/fenceplan.java at master · javaarchive/Java

This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Expand file tree

/

fenceplan.java

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
48 lines (46 loc) · 1.28 KB
/

fenceplan.java

Copy path

File metadata and controls

48 lines (46 loc) · 1.28 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import java.io.*;
import java.util.*;
public class fenceplan {
// Func Ref
// Output values
// 0 = p, q, r colinear
// 1 = Clockwise
// 2 = Counterclockwise
static int[][] matrix;
static Point[] graph;
public static int orientation(Point p, Point q, Point r)
{
int val = (q.y - p.y) * (r.x - q.x) -
(q.x - p.x) * (r.y - q.y);
if (val == 0) return 0; // collinear
return (val > 0)? 1: 2; // clock or counterclock wise
}
public static void main(String[] args) throws IOException{
BufferedReader f = new BufferedReader(new FileReader("fenceplan.in"));
StringTokenizer st = new StringTokenizer(f.readLine());
int N = Integer.parseInt(st.nextToken());
int M = Integer.parseInt(st.nextToken());
prev = new int[N];
matrix = new int[N][N];
graph = new Point[N];
for(int i = 0; i < N;i ++) {
st = new StringTokenizer(f.readLine());
int x,y;
x = Integer.parseInt(st.nextToken());
y = Integer.parseInt(st.nextToken());
graph[i] = new Point(x,y);
}
Arrays.fill(prev, -1);
}
static int[] prev;
public void crawl(int k) {
}
}
class Point{
int x = 0; int y = 0;
public Point() {}
public Point(int x, int y) {
this.x = x;
this.y = y;
}
}
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.