34 questions
3
votes
1
answer
269
views
Efficiently count the number of equilateral and isosceles triangles that can be constructed from a set of points
I have the coordinates of various points in the Cartesian coordinate system (coordinates are integers) and I need to count the number of equilateral and isosceles triangles that I can construct on ...
1
vote
2
answers
182
views
C For Loop Floyd's Triangle but different?
I need help on how to do a Flyod's Triangle style but instead of input value in rows, the triangle is based on the input value as a whole.
instead of;
Enter a number: 9
1
2 3
4 5 6
7 8 9 10
11 12 ...
0
votes
1
answer
479
views
How to generate a triangle free graph in Networkx (with randomseed)?
After checking the documentation on triangles of networkx, I've wondered if there is a more efficient way of generating a triangle free graph than to randomly spawn graphs until a triangle free one ...
1
vote
1
answer
244
views
Python: count specific subshapes in shape with intersecting lines
I want to count specific subshapes of a bigger shape with python.
For expample:
I draw a Triangle. I draw a diagonal line cutting the triangle in half. Now the program show draw this triangle with the ...
1
vote
0
answers
273
views
Count Triangles in Scala - Spark
i am trying to get into data analytics using Spark with Scala. My question is how do i get the triangles in a graph? And i mean not the Triangle Count that comes with graphx, but the actual nodes that ...
0
votes
2
answers
304
views
How to find a "triangle of friends" in a graph?
I have names of people that are friends and I am looking for triangles of friends, if there are any.
Example (names next to each other classify as friends, in the first row the first number represents ...
3
votes
0
answers
443
views
Number of possible triangles from an integer array in O(NlogN)
Given an array that contains positive integers. The task is to calculate the number of triplets a, b, c such that they can be the sides of a triangle or
max(a, b, c) < a + b + c - max(a, b, c)
the ...
-2
votes
1
answer
72
views
An algorithmic task with triangles
I have a problem with an algorithmic task. There is content of it: "You have ten points on a plane and none three of them are collinear, each pair of different points is connected by line segment,...
0
votes
1
answer
375
views
How I can copy triangle shape numbers in Python
I am solving some questions in Python and I am beginner level. I wonder how I can copy number that I found on internet. When I try to copy triangle shape number like:
75
95 64
17 47 82
18 35 87 10
20 ...
0
votes
1
answer
1k
views
Unity-3D how can i see polygon count in mobile phone? [closed]
I searched in internet for see polygon count on mobile phone but i didn't see. I just want to see polygon count with adding object step by step.Is there way to see this?Do i just have to see it in ...
0
votes
2
answers
1k
views
Trying to create a function to see if a triangle is valid, getting an error message on my function
Can someone help me on this error, when I compile my code in C, I get the following error messages:
error: too few arguments to function call, at least argument 'format' must be specified
how can I ...
3
votes
2
answers
6k
views
Finding total number of triangles using networkx
I want to count the total number of triangles in a graph using networkx python package.
I have tried the following:
import networkx as nx
g = ## some graph
t = nx.triangles(g)
However, nx.triangles()...
0
votes
3
answers
205
views
My Java-Triangle Code doesn't print the full Triangle
I have to write a code that prints a triangle which the length of the last line is the input number. Also the empty spaces have to be filled with dots.
It has to look like this.
Also, the code has ...
0
votes
4
answers
1k
views
Triangle , C++ construction, problem with calculating angles
I have a problem with my homework.
1) I should write the function SSS with inputs a, b and c. I need to output alpha, beta and gamma.
2) I should write the function SWS with inputs a, b, and gamma. ...
-1
votes
2
answers
133
views
problem with triangle angle in programm language C++ [closed]
could you help me?
I am new in programming and in C++
#include <iostream>
#include <cmath>
#include <math.h>
#include <cstdio>
using namespace std;
double SSS(double a, ...
0
votes
4
answers
1k
views
How do I let my program print a complete right angle triangle for certain values?
I tested the program out with 88 and it was left with one star to complete the triangle. 87, two stars 86 three stars. This went on for certain numbers.
These are the two options for programming ...
0
votes
1
answer
513
views
Triangle Counting/Clustering Neo4j
I would like to test Triangle Clustering in my Neo4j graph. Here is a sample:
CREATE(a:Person { name: "a" })-[:FRIENDS]->(b:Person {name : "b"}),
(a)-[:WORKS_AT]->(p:Business {name : "Mcdonalds"...
0
votes
2
answers
2k
views
JavaScript triangle with single function
I'm playing around with making triangles in Javascript and normally I've had to use 2 functions to make one. I recently tried to create one with a single function though, and it worked perfectly. But ...
1
vote
4
answers
3k
views
Printing triangle in C
I am new to C and I have this program where I am trying to print a triangle based on its height as such:
/\
/__\
So if the height is 2, then there are 2 of '/', '\' and '_'.
So I have written ...
6
votes
2
answers
1k
views
Number of triangles with N points inside
Given some points in plane (upto 500 points), no 3 collinear. We have to determine the number of triangles whose vertices are from the given points and that contain exactly N points inside them. How ...
-1
votes
8
answers
36k
views
How to make a triangle using for loop javascript
I have a simple question although i cannot manage to resolve this problem. Hope you can help. I need to make triangle using for loop and from this 4 exercises I don't know what to do with the third ...
-2
votes
1
answer
719
views
Counting triangles in a graph
My professor said that I should find a way to find the number of triangles in a graph. I have a problem what graph should I used but my professor suggested that I must first find a way to count the ...
4
votes
1
answer
1k
views
Extract All Triangles in Igraph with Labels
I have created an igraph with 1000 edges. My goal is to extract all the triangles found in that igraph but to include the label rather than just then number. I also want it to be in a dataframe form ...
0
votes
1
answer
140
views
Displaying large VRML file
I've VRML file that is 4.2GB big (!) and consists of 10 different shapes.
This is cloud of points (no edges or triangles).
How can I display such a big object? Everything I've tried just freezes.
Is ...
3
votes
1
answer
424
views
Printing out a rhombic pattern in java with "for" loop
I am having a hard time doing a school exercise in Java. We are asked to print out this pattern:
+++++++++++++++++++++++++++++++++++++++++++++
+++++++ +++++++ +++++++ +++++++ +++++++
+++++ ...
1
vote
1
answer
75
views
Number of triangles from a sorted sequence
Given a strictly increasing sequence of n positive integers A(1) < A(2) < ... < A(n). We need to find the number of triangles with side lengths as 3 distinct elements of this sequence.
...
2
votes
2
answers
929
views
Triangle counting in undirected graph
I got asked this in an interview and was told that O(n^2) is possible. Anyone has a simple approach for that?
Found here a paper telling me that it is as hard as matrix multiplication:
http://kam.mff....
0
votes
2
answers
729
views
C++ and Python version of the same algorithm giving different result
The following code is an algorithm to determine the amount of integer triangles, with their biggest side being smaller or equal to MAX, that have an integer median. The Python version works but is too ...
0
votes
2
answers
1k
views
Find triangles in a list of random numbers
I'm taking each element as "sum", "first" and "sec". If (first + sec < sum) I'll make a hashset(tmp) of these 3 and put this hashset into a larger hashset(triangle) containing all tmp hashsets. ...
2
votes
3
answers
1k
views
Divisors of triangle numbers (Euler 12)
I have found a couple of topics related to this very problem, I just want to know why my code returns incorrect data.
So we have to find the first triangle number having more than 500 divisors. ...
0
votes
1
answer
1k
views
Finding all possible pythagorean triangles within a set of triangles
I've looked at this thread: All possible Pythagorean Triples
Looks similar to mine but I can't get mine to work for some reason..
REVISION 1
#include <iostream>
#include <cmath>
using ...
0
votes
1
answer
1k
views
Fragment or geometry shaders: Count rendered triangles?
gl_PrimitiveID seems to count the number of primitives rendered. This seems to be available via both fragment and geometry shaders.
Would this be an accurate count of rendered triangles in the view ...
8
votes
4
answers
17k
views
Find all cycles in graph, redux
I know there are a quite some answers existing on this question. However, I found none of them really bringing it to the point.
Some argue that a cycle is (almost) the same as a strongly connected ...
0
votes
3
answers
207
views
Triangle count for model is doubled during render
I am working with the Trinigy 3d engine, and it reports models to have twice as many triangles during render than it does in the model display (let's say 4000 instead of 2000). If I render the model ...