Check If a Line Touches or Intersects a Circle in C++

Arnab Chakraborty
Updated on 22-Oct-2019 08:33:53

703 Views

Suppose we have a circle and another straight line. Our task is to find if the line touches the circle or intersects it, otherwise, it passes through outside. So there are three different cases like below −Here we will solve it by following steps. These are like below −Find perpendicular P between the center and given a lineCompare P with radius r −if P > r, then outsideif P = r, then touchesotherwise insideTo get the perpendicular distance, we have to use this formula (a center point is (h, k))$$\frac{ah+bk+c}{\sqrt{a^2+b^2}}$$Example Live Demo#include #include using namespace std; void isTouchOrIntersect(int a, ... Read More

How Skin Track Enables Your Arm to Function as a Touch Pad

Samual Sam
Updated on 22-Oct-2019 08:28:47

192 Views

New era Smart watches are computerized wristwatches whose functionality can go ahead of mere timekeeping. The utility of smart watches are no more limited to just showing the time, rather the recent ones can be handy for tasks such as elementary calculations, manage phone calls, listening music and much more.Nowadays, with the advent of a higher version of operating system, the basic purpose of smart watches has taken a paradigm shift. As it can run media players and can play digital audio and video files. It can also assist Bluetooth or USB headset. In fact, the recent watches can be ... Read More

Check If a Given Tree Graph is Linear in C++

Arnab Chakraborty
Updated on 22-Oct-2019 08:26:43

192 Views

Here we will see how to check whether a tree graph is linear or not. A linear tree graph can be expressed in one line, suppose this is an example of a linear tree graph.But this is not linear −To check a graph is linear or not, we can follow two conditionsIf the number of nodes is 1, then the tree graph is linearIf (n – 2) of its nodes have in-degree 2Example Live Demo#include #include #define N 4 using namespace std; class Graph{    private:    int V;    vector *adj;    public:    Graph(int v){     ... Read More

Amazon Echo: The Most Spoken About Automated Personal Assistant Device

Samual Sam
Updated on 22-Oct-2019 08:26:30

128 Views

Today, technology is a crucial part of our life. We accomplished many things with the assistance of technology. It shapes the future and help to make it friendly with nature. It ought to be for the people in order to make things easier and not more complex. Technology increases the value of society and streamlines human life. So, we should develop it to fulfill every requirement of the society in a positive manner as the new generation needs a life of luxurious convenience.Need of Easy AccessPeople today just need a remote control in their hands to control everything without putting ... Read More

Check If a Given String is a Sum String in C++

Arnab Chakraborty
Updated on 22-Oct-2019 08:21:51

363 Views

Here we will see how to check whether a string is sum-string or not. A string is said to be sum-string if the rightmost substring can be written as the sum of two substrings before it, and the same is recursively true for substring before it. Suppose a string like 12243660 is a sum string, like 12 + 24 = 36, and the 36 is present after 12 and 24 in the string, again 24 + 36 = 60, this is also present in the string.A string S can be called sum-string, if it follows this rule −𝑠𝑢𝑏𝑠𝑡𝑟𝑖𝑛𝑔(𝑖, 𝑥)+𝑠𝑢𝑏𝑠𝑡𝑟𝑖𝑛𝑔(𝑥+1, 𝑗)= ... Read More

Check if a Directed Graph is Strongly Connected in C++

Arnab Chakraborty
Updated on 22-Oct-2019 08:16:56

404 Views

Suppose we have a graph. We have to check whether the graph is strongly connected or not. A graph is said to be strongly connected, if any two vertices have a path between them, then the graph is connected. An undirected graph is strongly connected graph. Some undirected graph may be connected but not strongly connected. This is an example of a strongly connected graph.This is an example of a connected, but not strongly connected graph.Here we will see, how to check a graph is strongly connected or not using the following steps.Steps −Mark all nodes as not visitedStart DFS ... Read More

Check if Circle Lies Inside Ring of Concentric Circles in C++

Arnab Chakraborty
Updated on 22-Oct-2019 08:12:55

983 Views

We have two circles. The center of both of them is at the origin. The radius of these two circles is given. They are r and R, R > r. Another circle is also present. Its radius (r1) and the center point are given, we have to check whether that point is inside the ring formed by the first two circles or not.We can solve this using the Pythagorean theorem. compute the distance from the center of the circle and origin. Then if (distance – r1) >= r and (distance – r1) = R && dis+r1

How Mobile Apps Can Help You Reach More Customers

Samual Sam
Updated on 22-Oct-2019 08:07:37

173 Views

With the passing of every day at present, the landscape seems to change. Technology, with its rapidly innovative pace, sets the tone for a lot of the things – present and future. So is the case in the business landscape, where a lot of it has been transferred to the online ecosystem. Mobile has taken the world by storm in the past few years and having an application is the answer to everything that needs a solution. Likewise, most business people and entrepreneurs have switched to mobile apps to have an advantage in the markets they operate in.So, here are ... Read More

Check If a Given Binary Tree is SumTree in C++

Arnab Chakraborty
Updated on 22-Oct-2019 08:05:45

227 Views

Here we will see how to check whether a binary tree is sum-tree or not. Now the question is what is the sum-tree. A sum-tree is a binary tree where a node will hold the sum value of its children. The root of the tree will contain an entire sum of all elements below it. This is an example of sum-tree −To check this, we will follow a simple trick, we will find the sum of left and right subtree elements if the sum value is the same as the root, then that is sum-tree. This will be one recursive ... Read More

Weather Add-Ons Changing the Virtual Reality Experience

Samual Sam
Updated on 22-Oct-2019 08:02:40

152 Views

Virtual reality (VR) is all about hanging our suspicion and allowing our attention to imagine a different virtual world for experiencing thoughts. VR has taken our experience in movie and gaming to the next level. Now, VR has marked its presence into weather sensation too. It’s really fascinating to experience the presence of new weather add-ons.A Brief Overview on VRVirtual reality is an attempt to mimic the real world environment through a digital touch. The custom software produces lifelike images, vibrations, echoes, noises and other such impressions that replicate a real environment. A viewer using a VR device is typically ... Read More

Advertisements