Java Program to Show the Duality Transformation of Line and Point

This is a java program to show the duality transformation of line and point. The transformation corresponds from line to point and point to line. Here is the source code of the Java Program to Show the Duality Transformation of Line and Point. The Java program is successfully compiled and run on a Windows system. … Read more

advertisement

Java Program to Find the Volume of a Tetrahedron using Determinants

This is a Java Program to compute volume of tetrahedron using determinants. Call the four vertices of the tetrahedron (a, b, c), (d, e, f), (g, h, i), and (p, q, r). Now create a 4-by-4 matrix in which the coordinate triples form the columns of the matrix, with a row of 1’s appended at … Read more

advertisement

Java Program to Find Convex Hull using Quick Hull Algorithm

This is a Java Program to implement Quick Hull Algorithm to find convex hull. Here we’ll talk about the Quick Hull algorithm, which is one of the easiest to implement and has a reasonable expected running time of O(n log n). Here is the source code of the Java Program to Implement Quick Hull Algorithm … Read more

advertisement

Java Program to Check if Point is Inside Polygon

This is a Java Program to check whether a point lies inside, outside or on the Polygon. Following is a simple idea to check whether a point is inside or outside. 1) Draw a horizontal line to the right of each point and extend it to infinity 2) Count the number of times the line … Read more

advertisement

Java Program to Find the Position of a Point with Respect to a Line using Above-Below-on Test

This is a Java Program to check whether a point lies below, above or on the line. For any point t (xt, yt) on the plane, its position with respect to the line L connecting p and q is found by calculating the scalar s: s = A xt + B yt + C If … Read more

advertisement

Java Program to Check if Point is Inside or Outside a Circle

This is a Java Program to check whether a point lies inside, outside or on the circle. For any point t (xt, yt) on the plane, its position with respect to the circle defined by 3 points (x1, y1) , (x2, y2), (x3, y3). s = (x-xt)^2 + (y-yt)^2 – r*r If s < 0, ... Read more

advertisement

Java Program to Perform Polygon Containment Test

This is a Java Program to check whether a polygon contains another polygon or not. The class returns true if one polygon contains another, false otherwise. Here is the source code of the Java Program to Perform Polygon Containment Test. The Java program is successfully compiled and run on a Windows system. The program output … Read more

advertisement

Java Program to Find Nearest Neighbour using Linear Search

This is a Java Program to find nearest neighbor using linear search. The simplest solution to the NNS problem is to compute the distance from the query point to every other point in the database, keeping track of the “best so far”. This algorithm, sometimes referred to as the naive approach, has a running time … Read more

advertisement

Java Program to use Above Below Primitive to Test Whether Two Lines Intersect

This is a Java Program to whether two lines intersect or not. The above-below primitive can be used to test whether a line intersects a line segment. It does iff one endpoint of the segment is to the left of the line and the other is to the right. Segment intersection is similar but more … Read more

advertisement

Java Program to Find the Convex Hull using Graham Scan Algorithm

This is a Java Program to implement Graham Scan Algorithm. Graham’s scan is a method of computing the convex hull of a finite set of points in the plane with time complexity O(n log n). Here is the source code of the Java Program to Implement Graham Scan Algorithm to Find the Convex Hull. The … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.