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
0
votes
2 answers

How to operate DAC at update speed of 1MSPS?

This is my code for DAC using DMA. I want to generate a triangular wave of frequency 8kHz with DAC operating at update rate of 1MSPS. I am using CUBEMX and system work bench.I am using timer trigger for DAC. I am working on stm32L476 discovery…
user8398475
  • 61
  • 2
  • 7
0
votes
1 answer

I need to export a distance matrix in its triangular form to a .txt or a .csv file

So far I've tried all what I have found in internet. I have a distance matrix (dist class) and all the elements I've learned to "coerce" the matrix have not been effective. I want to keep the triangular form. Does any one already know how to export…
Hazlo Bob
  • 31
  • 7
0
votes
1 answer

sum triangular views of sparse matrices in eigen

Using Visual Studio 2010, I'm trying to express the following matlab code in eigen (from the repositories 3.3 branch) using sparse matrices: m = [1 2 3 ; 4 5 6; 7 8 9]; r = triu(m,1) + tril(m)'; that is, calculating the sum of the upper triangle of…
wonko realtime
  • 545
  • 9
  • 26
0
votes
3 answers

Triangular Distribution in VBA

What I currently have: Option Explicit Function Triangular(a As Double, b As Double, c As Double) As Double Randomize Application.Volatile Dim d As Double Dim uniform As Double Dim retval as Double d = (b - a) / (c - a) uniform = Rnd() …
JaySmith
  • 23
  • 1
  • 5
0
votes
1 answer

Snap SVG rotate & scale

I'm trying to scale and then rotate a triangle and then translate it to a given point in Snap SVG. I want to rotate the triangle around the top of it not the center, so i can build something like a pie. So I thought I scale first, then rotate and…
Chill3er
  • 41
  • 1
  • 1
  • 5
0
votes
1 answer

Get upper triangle in Matlab

I want to get the upper triangle from a matrix. MATLAB have the functions tril and triu, unfortunately they give the wrong triangle. I'm looking for following triangle, is there a command for it or must it be a loop? If so, how does it look? test=[1…
Orongo
  • 285
  • 1
  • 6
  • 16
0
votes
1 answer

Java calculating points of Angles in a non-right triangle

I am currently working on a project in which i need to draw a non-right triangle in the center of a JFrame using either, java.awt.Graphics's drawLine() or drawPolygon() methods. Both of these methods require the coordinates of all of the points to…
James Oswald
  • 510
  • 3
  • 12
  • 25
0
votes
1 answer

triangular plot using ggtern

I am trying to triplot some points with some regions in triangular plot this code: library(ggtern) g <- data.frame(x=c(1,.6,.6), y=c(0,.4,0), z=c(0,0,.4), Series="Green") r <- data.frame(x=c(0,0.4,0), y=c(0,0,0.4), z=c(1,0.6,0.6), …
user4544869
  • 53
  • 1
  • 5
0
votes
1 answer

Nested Loops to generate triangles, wrong way

I need to use nested loops to generate a triangle. The output needs to look like this. How many lines? 7 0000000 000000 00000 0000 000 00 0 Currently I have attempted to use this, but I am unsure on how to get the 0's to face…
0
votes
1 answer

how to get mouselistener notice clicks inside an imaginary triangle?

I have three points on a grid. I want my mouselistener to give me a heads up, when a point on the area within this imaginary triangle of three points has been clicked. how to do that??I dont wanna use a shape class or anything, since it is an…
melar
  • 202
  • 2
  • 15
0
votes
2 answers

Is angle between 2 vectors reflex? (C#)

I need to be able to check whether the angle between three points (A, B and C) which make up part of a shape is reflex (> PI radians), as in the diagram below (sorry for poor paint skills!): My points should always be anti-clockwise, and I always…
acernine
  • 729
  • 2
  • 6
  • 16
0
votes
1 answer

Null pointer exception when trying to access triangular array in method

I'm having an issue with trying to access my triangular array separately using a method, each time i try to use tarray[i][j] I get a null pointer exception unless it's done within the class creation, for example I have a get method and have used…
0
votes
3 answers

Matlab - generate random nonsingular triangular matrix

How can I generate a random triangular matrix? (upper and lower) Usually I use rand(n) but if I try tril(rand(n)) it will be singular and I don't want that.
0
votes
0 answers

Map a Responsive Triangle with JavaScript

I'd like to know if there is a way to map a responsible triangle using JavaScript.
0
votes
1 answer

Inplace restoration of upper/lower part of distributed lower/upper triangular matrix

I wonder if there exists any Scalapack routine that may convert a triangular matrix back to a general one, i.e. copies the lower/upper part to the upper/lower part - I couldn't find it yet. I know there exists an easy workaraound using p?geadd with…
zp3
  • 5
  • 2