How To Install libmath-convexhull-perl on Ubuntu 18.04

In this tutorial we learn how to install libmath-convexhull-perl on Ubuntu 18.04. libmath-convexhull-perl is Perl module to calculate convex hulls using Grahams scan (n*log(n))

Introduction

In this tutorial we learn how to install libmath-convexhull-perl on Ubuntu 18.04.

What is libmath-convexhull-perl

libmath-convexhull-perl is:

Math::ConvexHull is a simple module that calculates convex hulls from a set of points in 2D space. It is a straightforward implementation of the algorithm known as Graham’s scan which, with complexity of O(n*log(n)), is the fastest known method of finding the convex hull of an arbitrary set of points. There are some methods of eliminating points that cannot be part of the convex hull. These may or may not be implemented in a future version.

The implementation cannot deal with duplicate points. Therefore, points which are very, very close (think floating point close) to the previous point are dropped since version 1.02 of the module. However, if you pass in randomly ordered data which contains duplicate points, this safety measure might not help you. In that case, you will have to remove duplicates yourself.

There are three methods to install libmath-convexhull-perl on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install libmath-convexhull-perl Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install libmath-convexhull-perl using apt-get by running the following command:

sudo apt-get -y install libmath-convexhull-perl

Install libmath-convexhull-perl Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install libmath-convexhull-perl using apt by running the following command:

sudo apt -y install libmath-convexhull-perl

Install libmath-convexhull-perl Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install libmath-convexhull-perl using aptitude by running the following command:

sudo aptitude -y install libmath-convexhull-perl

How To Uninstall libmath-convexhull-perl on Ubuntu 18.04

To uninstall only the libmath-convexhull-perl package we can use the following command:

sudo apt-get remove libmath-convexhull-perl

Uninstall libmath-convexhull-perl And Its Dependencies

To uninstall libmath-convexhull-perl and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove libmath-convexhull-perl

Remove libmath-convexhull-perl Configurations and Data

To remove libmath-convexhull-perl configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge libmath-convexhull-perl

Remove libmath-convexhull-perl configuration, data, and all of its dependencies

We can use the following command to remove libmath-convexhull-perl configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge libmath-convexhull-perl

References

Summary

In this tutorial we learn how to install libmath-convexhull-perl package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.