Questions tagged [triangular]

Use this tag when you have a programmatic problem related to coordinates, area, or any other property of a shape that forms a triangle.

The shape formed by a polygon which has three sides is said to be triangular in nature.

Triangular shape has been discussed, analyzed, formed mathematical formulas around, explained in different contexts since the inception of the idea of geometry.

You can read more about triangular shape and it's properties here.

157 questions
1
vote
0 answers

generate 2d triangular mesh opencv

Is it possible generate a 2D triangular mesh using opencv python? My ultimate goal is obtain a binary image with the mesh drawn in order to use this "new image" as a mask layer. I have this image: I want to generate something like this: This…
marco
  • 915
  • 4
  • 17
  • 35
1
vote
1 answer

opencv python Triangular mesh having coordinates

I have a mesh in a stl file ( https://dl.dropboxusercontent.com/u/710615/stlMidpoint.stl ) With this code : from stl import mesh import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import cv2 def unique(a): …
marco
  • 915
  • 4
  • 17
  • 35
1
vote
2 answers

How to make a triangular top/bottom of section?

I want to make a triangular shape on bottom of section. But it is not responsive way... when I resize a window, space between :before and :after is bigger and bigger. How to make it with another way ? JSFIDDLE…
1
vote
1 answer

Using numpy's genfromtxt to load a triangular matrix with python

I have a text file containing an upper 'triangular' matrix, the lower values being omitted (here's an example below): 3 5 3 5 1 8 1 6 5 8 5 8 1 1 6 2 9 6 4 2 0 5 2 1 0 0 3 2 2 5 1 0 1 0 1 3 6 …
1
vote
1 answer

Lower triangular of matrix in eigen

How to use eigen library to compute lower triangular of input matrix without changing columns order? for example for matrix: A=[1 2 3;4 5 6 ;7 8 9] I want the result to be: 1 0 0 4 0 0 7 0 0
abbas
  • 11
  • 1
  • 3
1
vote
1 answer

Ruby, returning the nth triangular number and returning 0 for out of range values

I'm currently doing some Code Wars training and am having trouble with the nth triangular test. Here is the question: You need to return the nth triangular number. You should return 0 for out of range values, but you will always be passed a…
Ryan Waits
  • 197
  • 1
  • 5
  • 18
1
vote
1 answer

How can I compile GNU Triangulated Surface Library GTS in windows for Visual Studio C++ project?

How can I install/build/compile GNU Triangulated Surface Library GTS using visual studio 2010 c++ under windows platform. I want to use gts library in my visual studio c++ project. I tried a lot but no success. I couldn't even find the instruction…
maxpayne
  • 1,111
  • 2
  • 21
  • 41
0
votes
0 answers

How to handle degenerate cases in Seidel's Triangulation Algorithm?

I'm trying to implement Seidel's Triangulation Algorithm, and already completed the core logic, which works perfectly for non-degenerated polygon with holes. But I don't know how to preceed to handle more general inputs. Including a vertex on a…
0
votes
1 answer

unexpected results while applying curve fitting to triangular pdf using lmfit

I have a set of points with x & y coordinates x = np.array([0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360, 390]) y = np.array([0, 1.2, 2.8, 1.7, 1.4, 1.2, 1.1, 0.91, 0.74, 0.61, 0.5, 0.28, 0.17, 0]) the points can fairly draw a…
0
votes
1 answer

Probability distribution of results from one, two and more draws

I am learning python and I found something not intuitive from my perspective. I was trying to print Gausses curve, based on output from lottery. In that program I can set draw range, number of draws in one game and number of games. I sum results of…
0
votes
0 answers

density of x^2 when x has a triangular distribution

I would like to find out the x^2 density distribution by given x distribution. Currently my samples fall into triangular distribution(min = 1, max = 6, mode = 3). How to generate samples for x^2 distribution given x distribution is triangular in r ?…
CindyJ
  • 1
  • 2
0
votes
0 answers

(R) Implementing a program which solves lower triangular systems

I have to write a program which takes a lower triangular matrix L and a vector b as input, and a solution x as output. So first I computed a trivial program which only can handle 3x3 triangular matrices. L3solve <- function(L,b) { b[1] <- b[1] /…
Mugge
  • 1
  • 1
0
votes
0 answers

Is there a way to impute or predict the NANs in this triangular dataframe?

This DataFrame has values over the upper left triangle and the diagonal, with the rest of values being NANs I don't want to use a looping linear regression model which would work on a sample size of 1. I assume there is a simple way to do…
0
votes
1 answer

Python Binning using triangular bins

I'm trying to find a simple python module/package that has implemented 2D triangular bins so that it can be use in a similar fashion to scipy binned_statistic_dd. Is anyone aware of such a tool? I've searched but not found anything: the closest I've…
jpmorr
  • 500
  • 5
  • 25
0
votes
1 answer

How to get the 2D mesh of only visible surfaces when projecting a 3D triangular mesh onto a plane

If I had a triangular mesh surface, it could be rendered according to whatever computer graphics does to render it, and done properly only the front most triangles would be visible. What I am interested in is something similar to the rendering…
Vince W.
  • 3,561
  • 3
  • 31
  • 59