This is a purely math question, I believe.
I have a camera object in an arbitrary coordinate system. I have the direction vector of the camera, and I have a vector that points in the direction of north along the surface of the sphere.
I wish to calculate the angle of the camera in regards to the north vector. Is there a simple way to c...
Suppose I have a line segment going from (x1,y1) to (x2,y2). How do I calculate the normal vector perpendicular to the line?
I can find lots of stuff about doing this for planes in 3D, but no 2D stuff.
Please go easy on the maths (links to worked examples, diagrams or algorithms are welcome), I'm a programmer more than I'm a mathematic...
I have a question i know a line i just know its slope(m) and a point on it A(x,y) How can i calculate the points(actually two of them) on this line with a distance(d) from point A ???
I m asking this for finding intensity of pixels on a line that pass through A(x,y) with a distance .Distance in this case will be number of pixels.
...
Hi, all.
Here at Acme Widgets, we use an Avaya 8xxx series PBX. Some of the Vectors that are coded into the PBX are super important, in that if they're changed in the wrong way, pretty much all of our telephony arena applications and features go haywire (IVR, CTI, CRM, and ACD).
There have been some recent discussions where we've disa...
Goal: from a list of vectors of equal length, create a matrix where each vector becomes a row.
Example:
> a <- list()
> for (i in 1:10) a[[i]] <- c(i,1:5)
> a
[[1]]
[1] 1 1 2 3 4 5
[[2]]
[1] 2 1 2 3 4 5
[[3]]
[1] 3 1 2 3 4 5
[[4]]
[1] 4 1 2 3 4 5
[[5]]
[1] 5 1 2 3 4 5
[[6]]
[1] 6 1 2 3 4 5
[[7]]
[1] 7 1 2 3 4 5
[[8]]
[1] 8 1 2 3...
well i have most probably an extremly stupid problem but could not figure it out and I m about to lose my sanity hope someone can help
vector<CvMat*> sample;
for(int x = 0; x < 29; x += 2)
{
for(int b = 0; b < 22; b += 2)
{
cvmSet(g, 0, b, cvmGet(NormalVector, 0, x + b));
cvmSet(g, 0, b + 1, cvmGet(NormalVector, 0, ...
I'm using a vector of pointers to objects. These objects are derived from a base class, and are being dynamically allocated and stored.
For example, I have something like:
vector<Enemy*> Enemies;
and I'll be deriving from the Enemy class and then dynamically allocating memory for the derived class, like this:
enemies.push_back(new M...
I know this is more high school math(wow been a long time since I was there) but I am trying to solve this programatically so I am reaching out to the collective knowledge of stackoverflow
Given this layout:
Midpoint is my reference point and in an array I have the vector points of all other points (P)
I can get to this state with c...
I have a bunch of vectors normal to window surfaces in a 3D modelling software. Projected to the XY-Plane, I would like to know in which direction they are facing, translated to the 8 compass coordinates (North, North-East, East, South-East, South, South-West, West and North-West).
The vectors work like this:
the X axis represents Eas...
I have 3 Vectors, Up Right and Front that represent a direction.
I need to convert these into an XYZ angle (3 floats) so i can use with glRotatef()
Please help
[EDIT]
Its not rendering properly. can you see if its anything blatant here: pastebin.com/f6683492d
...
Basically I'll be using Autocorrelation method to try to find cloned regions within an image.
This is what i did in MATLAB
i = imread ('D:\image.jpg')
I = rgb2gray(i);
imshow(I);
f = fspecial('LOG');
h = imfilter(I,f);
x = xcorr2(double(h), double(h));
imagesc(x); figure(gcf)
basically loading up an image, changing it to greyscale, ap...
#include "iostream"
#include "vector"
using namespace std;
const vector<int>& Getv()
{
vector<int> w(10);
w[0]=10;
cout<<w.size()<<endl;
return w;
}
//Now when I write in main:
vector<int>v = Getv();//Throws exception
//and the below rows has no effect
vector<int>v;
v=Getv()//w does not change
please what is the problem?
Hani Almousl...
I have myself a linear grid of Vector2s stored in a Vector2[,] array, and i also have another Vector2 that lies within this grid. How can i simply extract both the nearest 4 grid points and their indexes in the array? I'm totally stumped...
...
Is there a way in R to build a new dataset consisting of a given set of vectors -- median1, median2, median3, median4 -- which are median vectors from a previous dataset s?
median1 = apply(s[,c("A1","B1","C1","D1","E1","F1","G1","H1","I1")],1,median)
median2 = apply(s[,c("A2","B2","C2","D2","E2","F2","G2","H2","I2")],1,median)
median3 ...
I'm looking for a software for drawing scientific data, mostly vectors, coordinate systems and diagrams, for example:
...
I've been trying all night, and talk of maps, arrays, vectors and hash_maps have filled my head. im just confused now. i posted a previous question here: http://stackoverflow.com/questions/1687085/c-map-really-slow
problem was fixed but it seems map's are still not fast enough. i need to keep adding data. data is added ALOT during run t...
I'm trying to put a vector variable inside a struct in Google's Go programming language. This is what I have so far:
Want:
type Point struct { x, y int }
type myStruct struct {
myVectorInsideStruct vector;
}
func main(){
myMyStruct := myStruct{vector.New(0)};
myPoint := Point{2,3};
myMyStruct.myVectorInsideStruct.Push(myPoint);
}
...
In the following code, I create one peg puzzle then do a move on it which adds a move to its movesAlreadyDone vector. Then I create another peg puzzle then do a move on it which adds a move to its movesAlreadyDone vector. When I print out the values in that vector for the second one, it has the move in it from the first one along with th...
Hey there! I'm doing this project and right now I'm trying to:
create some of objects and store them in vectors, which get stored in another vector V
iterate through the vectors inside V
iterate through the objects inside the individual vectors
Anyway, I was just searching the web and I came accross the stl for_each function. It seem...
I have two vector classes:
typedef struct D3DXVECTOR3 {
FLOAT x;
FLOAT y;
FLOAT z;
} D3DXVECTOR3, *LPD3DXVECTOR3;
and
class MyVector3{
FLOAT x;
FLOAT y;
FLOAT z;
};
and a function:
void function(D3DXVECTOR3* Vector);
How is it possible (if it's possible) to achieve something like this:
MyVector3 vTest;
f...