Open In App

Geometric Algorithms

Last Updated : 22 Feb, 2024
Like Article

Geometric algorithms are a type of algorithm that deal with solving problems related to geometry. These algorithms are used to solve various geometric problems such as computing the area of a polygon, finding the intersection of geometric shapes, determining the convex hull of a set of points, and many other tasks related to geometric objects and their properties. Geometric algorithms are important in various fields such as computer graphics, computer-aided design, robotics, and geographical information systems.

Pattern Printing:



Rectangle | Square | Circle:


3D Objects:

Polygon and Convex Hull:

Standard Problems on Geometric Algorithm:

Quick Links :

Similar Reads

Number of GP (Geometric Progression) subsequences of size 3
Given n elements and a ratio r, find the number of G.P. subsequences with length 3. A subsequence is considered GP with length 3 with ration r. Examples: Input : arr[] = {1, 1, 2, 2, 4} r = 2 Output : 4 Explanation: Any of the two 1s can be chosen as the first element, the second element can be any of the two 2s, and the third element of the subseq
15+ min read
Find Harmonic mean using Arithmetic mean and Geometric mean
Given two numbers, first calculate arithmetic mean and geometric mean of these two numbers. Using the arithmetic mean and geometric mean so calculated, find the harmonic mean between the two numbers. Examples: Input : a = 2 b = 4 Output : 2.666 Input : a = 5 b = 15 Output : 7.500 Arithmetic Mean: Arithmetic Mean 'AM' between two numbers a and b is
5 min read
Sum of Arithmetic Geometric Sequence
In mathematics, an arithmetico–geometric sequence is the result of the term-by-term multiplication of a geometric progression with the corresponding terms of an arithmetic progression. is an arithmetico–geometric sequence.Given the value of a(First term of AP), n(Number of terms), d(Common Difference), b(First term of GP), r(Common ratio of GP). Th
9 min read
Find N Geometric Means between A and B
Given three integers A, B and N the task is to find N Geometric means between A and B. WE basically need to insert N terms in a Geometric progression. where A and B are first and last terms. Examples: Input : A = 2 B = 32 N = 3 Output : 4 8 16 the geometric progression series as 2, 4, 8, 16 , 32 Input : A = 3 B = 81 N = 2 Output : 9 27 Approach : L
5 min read
Draw geometric shapes on images using OpenCV
OpenCV provides many drawing functions to draw geometric shapes and write text on images. Let's see some of the drawing functions and draw geometric shapes on images using OpenCV. Some of the drawing functions are : cv2.line() : Used to draw line on an image. cv2.rectangle() : Used to draw rectangle on an image. : Used to draw circle o
3 min read
Minimum number of operations to convert a given sequence into a Geometric Progression
Given a sequence of N elements, only three operations can be performed on any element at most one time. The operations are: Add one to the element.Subtract one from the element.Leave the element unchanged. Perform any one of the operations on all elements in the array. The task is to find the minimum number of operations(addition and subtraction) t
14 min read
Geometric Progression
A sequence of numbers is called a Geometric progression if the ratio of any two consecutive terms is always the same. In simple terms, A geometric series is a list of numbers where each number, or term, is found by multiplying the previous term by a common ratio r. The general form of Geometric Progression is: Where, a = First term r = common ratio
6 min read
Geometric Median
In normal median, we find a point that has minimum sum of distances. Similar concept applies in 2-D space. Given N points in 2-D space, the task is to find out a single point (x, y) from which the sum of distances to the input points are minimized (also known as the centre of minimum distance).Examples: Input: (1, 1), (3, 3) Output: Geometric Media
15+ min read
Integer part of the geometric mean of the divisors of N
Given an integer N, the task is to find the integer part of the geometric mean of the divisors of N. The Geometric Mean is a special type of average where we multiply the numbers together and then take a square root (for two numbers), cube root (for three numbers), and so on. Examples: Input: N = 4 Output: 2 Divisors of 4 are 1, 2 and 4 Geometric m
3 min read
Check whether nodes of Binary Tree form Arithmetic, Geometric or Harmonic Progression
Given a binary tree, the task is to check whether the nodes in this tree form an arithmetic progression, geometric progression or harmonic progression.Examples: Input: 4 / \ 2 16 / \ / \ 1 8 64 32 Output: Geometric Progression Explanation: The nodes of the binary tree can be used to form a Geometric Progression as follows - {1, 2, 4, 8, 16, 32, 64}
15+ min read
Article Tags :
Practice Tags :