## integration – Evaluate the triple integral \$iiintlimits_Efrac{yzdxdydz}{x^2+y^2+z^2}\$ using spherical coordinates

How to evaluate triple integral $$iiintlimits_Efrac{yzdxdydz}{x^2+y^2+z^2}$$
when $$E$$ is bounded by $$x^2+y^2+z^2-x=0$$?

I know that spherical coordinates mean that $$x=rsinthetacosvarphi,quad y=rsinthetasinvarphi,quad z=rcostheta$$
and this function in spherical coordinates is
begin{align*} &iiintlimits_Efrac{yzdxdydz}{x^2+y^2+z^2} = iiintlimits_Efrac{r^2sintheta}{r^2sin^2thetacos^2varphi + r^2sin^2thetasin^2varphi + r^2cos^2theta}drdtheta dvarphi = \ &iiintlimits_Efrac{r^2sintheta}{r^2(sin^2thetacos^2varphi + sin^2thetasin^2varphi + cos^2theta)}drdtheta dvarphi = iiintlimits_Efrac{sintheta}{sin^2thetacos^2varphi + sin^2thetasin^2varphi + cos^2theta}drdtheta dvarphi end{align*}
but I don’t know how to write $$E$$ as set and convert it to spherical coordinates, and also what happens with this function after conversion. Triple integrals is now topic for me and I have never used spherical coordinates before, so I would be grateful if anyone can help me with this.

Posted on Categories Articles

## unity – How do I modify the coordinates of an object from a script?

You should be able to find something like this in every single Unity tutorial ever written, so please be sure to search for existing documentation and guides before asking here.

``````void MoveObjectTo(GameObject mover, Vector3 position) {
mover.transform.position = position;
}
``````

Posted on Categories Articles

## data – Sorting a list of coordinates by their value – within the coordinate

Given is a simplified list of coordinates.

``````list1={{-2,5,10},{9,-15,20},{-7,5,2}}
``````

What I want to do is sort the numbers withing the coordinates after their value (from max to min) like this.

``````result={{10,5,-2},{20,9,-15},{5,2,-7}}
``````

So far I only found questions that were concerned with ordering the coordinates but none of them were concerend with sorting insides of the coordinates.

Thank you very much for your help.

Posted on Categories Articles

## calculating coordinates to plot pie on Google earth

I want to plot 2D pie shape on google earth/MAp with given single center coordinates, radius and pie angle. How can i plot pie shape with these given info.
Kindly share any equation to plot it

Thanks

Posted on Categories Articles

## equation solving – Draw in detail a polygon and coordinates as a result of a system of inequalities,(linear programming) ¿ how to implement?

This is the set of inequalites that generates a linear programming problem whose
objective function is

$$f(x,y)=9x +12y$$,

$$1rightarrow{}x+2yleq{500}$$,

$$2rightarrow{}2x +y leq{520}$$,

$$3rightarrow{}2x+5y leq{}1200$$,

$$4rightarrow{}x leq{}0$$,

$$5rightarrow{}y leq{}0$$,

I need to maximize the objective function, but the graphics are unclear when it comes to the points,
a) then the problem to be solved by MMA would be to show me a graph with enough detail with the coordinates of the solution polygon, drawn it by hand, with geogebra, symbolab and it is not possible to appreciate it well (note: I do not know the symplex method. And this is not a task, is personal knowledge)
b) I have never solved a linear programming problem using MMA and I would like to know how it can be done using the mathematical syntax.

If you can help me, I would appreciate it very much

Posted on Categories Articles

## calculus – Double integrals in polar coordinates with unexpected result

I have been working on an exercice where I need to convert to polar coordinates : To me, it makes perfect sense that $$(x + y).dx.dy$$ became : $$(r.cos(theta) + r.sin(theta)).r.dr.dtheta$$

What I don’t understand is that, I was expecting to work between $$r = -1$$ and $$r = -2$$ ;

$$theta = – pi/2$$ and $$theta = pi/2$$

Instead, the solution puts $$r = 1$$ and $$r = 2$$ ;
$$theta = pi/2$$ and $$theta = 3pi/2$$

Could you tell me why ? (I am trying to grasp this new concept)

Posted on Categories Articles

## 3d – Generating a mesh from a set of generatively produced co-ordinates

Using Unity I’ve been producing sculptural forms that look like this. It’s made of patterns of cubes that twist around each other using a flocking algorithm. I’m trying to get it into a 3D printable format. From unity I export a PLY that is a list of the co-ords of each cube that looks like:

``````ply
format ascii 1.0
element vertex 17500
property float x
property float y
property float z
35 2.521441 0
34.72401 -2.06799 4.386663
33.90041 3.202552 8.704146
...
``````

Then I’ve imported that into meshlab and run `Filters > Remeshing, Simplification and Reconstruction > Surface Reconstruction: Ball Pivoting` with the default parameters. This is the result (different iteration so doesn’t match top image but similar) which is ok, but obviously not 3d printable.

Is there a better way of doing this in Unity to create a single mesh? I’d be happy with either a single mesh with individual lines or a mesh that makes a single shape as if it were shrink wrapped.

Posted on Categories Articles

## java – SQL structure to save coordinates for spigot plugin

I’m writing a spigot plugin where I give the user the possibility to send a message to the admins of the server. One of the requirements is that the coordinates of the player are stored, when the message is sent, and that it is stored in a sql table, so that admins on multiple spigot servers can access them independently of where the message was sent originally.

I have got a simple sql table, which stores the message, the player’s uuid, etc in a table, but I really dislike the idea that I have to store all three values of the `Vec3` in separate columns. I googled for a possibility to simply store a Vec3 via SQL, but had no luck.

Here’s an overview of my current table: I just have this one table with the data in it, which I create like this:

``````public static void initialiseDatabaseTables() {
try {
PreparedStatement ps = DatabaseConnector.getConnection().prepareStatement(
"CREATE TABLE IF NOT EXISTS Meldung ("
+ "id INT AUTO_INCREMENT NOT NULL, "
+ "UUID VARCHAR(64), "
+ "NAME VARCHAR(64), "
+ "MESSAGE TEXT, "
+ "XCOORD INT, "
+ "YCOORD INT, "
+ "ZCOORD INT, "
+ "primary key(id))");

ps.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
}
``````

I’d like to know how I can improve in this matter, or the general way how my data is stored. I’m particularly interested in alternative methods to store these coordinates, I don’t know why, I find my current way very unsatisfying.

Posted on Categories Articles

## shaders – How to convert from frag position to UV coordinates when my viewport doesn’t cover the screen?

So, I’m implementing SSAO as part of my rendering pipeline using OpenGL/GLSL. It works pretty well when I have a camera that takes up the entire screen. However, when my camera is smaller than the full screen size, the SSAO texture doesn’t get sampled correctly. Here is the relevant GLSL shader code:

``````// Convert from clip-space
vec2 fragCoords = (fragPos.xy/ fragPos.w); // fragPos is MVP * worldPosition
vec2 screenCoords = fragCoords * 0.5 + 0.5; // Convert from (-1, 1) to (0, 1) to sample UV coordinates

// Sample texture
float ssaoFactor = texture2D(ssaoTexture, screenCoords).r;
``````

I know that there is some funkiness going on with the viewport, but the fixes that I’ve tried haven’t worked. My first thought was to scale fragCoords by normalized size of my viewport (e.g. vec2(0.5, 0.5) for a viewport with half of the width and height of the screen), but that just produced a very strange result. Any thoughts?

Posted on Categories Articles

## plotting – How to store outputs as coordinates and use ListPlot to plot them?

so I have a program that outputs a desired value for incrementing values of alpha. Right now, my program prints a list of these for 40 values of alpha in the form {alpha, newValue}.

``````d = 1000;
For(k = 1, k <= 40, k++,
alpha = 0.1*k;
fd = 3*d^2/(Pi^2);
fs = fd*FareySequence(d);
count = 0;
For(i = 1, i < fd, i++,
For(j = (i - 1), j > 0, j--,
If((fs((i)) - fs((j))) < alpha, count++, Break())););
newValue = count/d^2;
Print("{", alpha, ",", newValue, "}");
);
``````

Here are the first few outputs:

``````{0.1,0}
{0.2,0}
{0.3,0}
{0.4,1911/100000}
{0.5,13593/250000}
{0.6,90521/1000000}
..
..
..
{3.9,1155653/1000000}
{4.,74163/62500}
``````

I want to make a plot all of these outputs as coordinates. I want to plot these point on a graph with alpha on the x axis and newValue on the y axis. Any help would be appreciated.

Posted on Categories Articles