## How to get a vertical z axis in a 3D plot of mathematica?

I’m plotting some data as a 3D graph using mathematica.

``Plot3D[{Pcase1[Dy, D\[Phi]], Pcase2[Dy, D\[Phi]]}, {Dy, 0, 1}, {D\[Phi], 0, 0.5}, Boxed -> False, AxesLabel -> Automatic, ScalingFunctions -> {"Reverse", None, None}, ColorFunction -> "BlueGreenYellow"] ``

It generates a plot shown below.

The problem with this plot is that the Z-axis is not vertical. How do I make the Z-axis vertical?

Update: I looked at surface plot examples in Matlab documentation and found that the Z-axis seems to be vertical in their examples. One figure for illustration with high elevation is shown below:

## Where can I find info on World Axis (4e) Sorrowsworn and Nightwalkers?

To the best of my knowledge, in 4th edition, Sorrowsworn were defined as powerful psychopomps who maintain the preservation of the cycle of death and rebirth, and/or as Exarches of the Raven Queen, and Nightwalkers were powerful "shadowy" undead (which I think wasn’t that big a departure from their previous lore) but I cannot recall what books specifically talk about these entities or what they specifically say.

## Cylindrical billboarding around an arbitrary axis in geometry shader

I found an answer on this site relating to this question already, but it doesn’t seem applicable in the context of my project.

Basically I’d like to create a method which fits this signature:

``float3x3 AxisBillboard(float3 source, float3 target, float3 axis) ``

That is to say, when given a source point (i.e an object’s position in world space), a target (camera position in world space), and an axis (the object’s up vector, which is not necessarily the global y axis), it produces a 3×3 rotation matrix by which I can multiply the vertices of my point so that it’s properly rotated.

I’ve found many solutions and tutorials online which work nicely assuming I only want to rotate around the y axis.

For example, here’s a solution which billboards around the global y axis:

``float3 dir = normalize(target - source);      float angleY = atan2(dir.x, dir.z); c = cos(angleY); s = sin(angleY);      float3x3 rotYMatrix; rotYMatrix[0].xyz = float3(c, 0, s); rotYMatrix[1].xyz = float3(0, 1, 0); rotYMatrix[2].xyz = float3(-s, 0, c); ``

For context, I’m working on a grass shader, and each individual blade of grass should be billboarded to face the camera while remaining aligned with the normal of the terrain.

## How to move axis and ticklables in RegionPlot to the top? How to change border line color?

I use this code

``RegionPlot[Sin[t^(1/3)*y] > 0, {y, 0, 5}, {t, 0, 8},   FrameLabel -> {"y", Rotate["t", 270 Degree]}] ``

and the result is

Now, I have three questions:

1. How can I move the $$y$$ axis (and ticklabels) to the top instead of bottom?
2. How can I change border lines color?
3. Is it possible to change the color of one of the blue parts?

## C++ Help with Separating Axis Theorem

I am trying to detect collision between two triangles using Separating Axis Theorem however I am unaware what is wrong with my code. The CollisionHelper::isTriangleIntersectingTriangle is called every frame and passes in the vertices of both triangles. It never returns true, however. I’ve been stuck on this for days now. Any help is appreciated.

``glm::vec3 CalcSurfaceNormal(glm::vec3 tri1, glm::vec3 tri2, glm::vec3 tri3) {     //Subtracts each coordinate respectively     glm::vec3 u = tri2 - tri1;     glm::vec3 v = tri3 - tri1;      glm::vec3 nrmcross = glm::cross(u, v);     nrmcross = glm::normalize(nrmcross);     return nrmcross; }  bool SATTriangleCheck(glm::vec3 axis, glm::vec3 tri1vert1, glm::vec3 tri1vert2, glm::vec3 tri1vert3, glm::vec3 tri2vert1, glm::vec3 tri2vert2, glm::vec3 tri2vert3) {     int t1v1 = glm::dot(axis, tri1vert1);     int t1v2 = glm::dot(axis, tri1vert2);     int t1v3 = glm::dot(axis, tri1vert3);     int t2v1 = glm::dot(axis, tri2vert1);     int t2v2 = glm::dot(axis, tri2vert2);     int t2v3 = glm::dot(axis, tri2vert3);      int t1min = glm::min(t1v1, glm::min(t1v2, t1v3));     int t1max = glm::max(t1v1, glm::max(t1v2, t1v3));     int t2min = glm::min(t2v1, glm::min(t2v2, t2v3));     int t2max = glm::max(t2v1, glm::max(t2v2, t2v3));       if ((t1min < t2max && t1min > t2min) || (t1max < t2max && t1max > t2min))             return true;     if ((t2min < t1max && t2min > t1min) || (t2max < t1max && t2max > t1min))             return true;      return false; }  bool CollisionHelper::isTriangleIntersectingTriangle(glm::vec3 tri1, glm::vec3 tri2, glm::vec3 tri3, glm::vec3 otherTri1, glm::vec3 otherTri2, glm::vec3 otherTri3) {     //Triangle surface normals, 2 axes to test     glm::vec3 tri1FaceNrml = CalcSurfaceNormal(tri1, tri2, tri3);     glm::vec3 tri2FaceNrml = CalcSurfaceNormal(otherTri1, otherTri2, otherTri3);      glm::vec3 tri1Edge1 = tri2 - tri1;     glm::vec3 tri1Edge2 = tri3 - tri1;     glm::vec3 tri1Edge3 = tri3 - tri2;     glm::vec3 tri2Edge1 = otherTri2 - otherTri1;     glm::vec3 tri2Edge2 = otherTri3 - otherTri1;     glm::vec3 tri2Edge3 = otherTri3 - otherTri2;      //axes     //TODO: may need to (un)normalize the cross products     glm::vec3 axis1 = tri1FaceNrml;     glm::vec3 axis2 = tri2FaceNrml;     glm::vec3 axis3 = glm::normalize(glm::cross(tri1Edge1, tri2Edge1));     glm::vec3 axis4 = glm::normalize(glm::cross(tri1Edge1, tri2Edge2));     glm::vec3 axis5 = glm::normalize(glm::cross(tri1Edge1, tri2Edge3));     glm::vec3 axis6 = glm::normalize(glm::cross(tri1Edge2, tri2Edge1));     glm::vec3 axis7 = glm::normalize(glm::cross(tri1Edge2, tri2Edge2));     glm::vec3 axis8 = glm::normalize(glm::cross(tri1Edge2, tri2Edge3));     glm::vec3 axis9 = glm::normalize(glm::cross(tri1Edge3, tri2Edge1));     glm::vec3 axis10 = glm::normalize(glm::cross(tri1Edge3, tri2Edge2));     glm::vec3 axis11 = glm::normalize(glm::cross(tri1Edge3, tri2Edge3));      //Perform SAT     if (SATTriangleCheck(axis1, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis2, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis3, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis4, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis5, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis6, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis7, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis8, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis9, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis10, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis11, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;      return false; } ``

## Plotting data from a list of rules, infer axis titles from the rules with units

I have data, with units, organized as a list of rules; this is so I can slice the data in different ways based on the variables represented.

I’m trying to find the most direct way to plot this and get axis titles with both the variable from the rule and unit from the values. I don’t want to manually label the plots each time, so if Plot doesn’t have a built-in then how can I write a function to do the inference? I’m looking for the most DRY approach possible.

This gives me the units, but not the variable names, in the labels:

``data = {    y -> {0, 33.2} (Quantity[1, ("KipsForce")/("Inches")^2]),    x -> {0, 6} 10^-4    }; ListLinePlot[Transpose@({x, y} /. data), AxesLabel -> Automatic] ``

On the same example, is it possible to retain units like "in/in"? I’ve done this by manually specifying the labels and using `HoldForm` to avoid evaluating the cancellation, but I can’t get that to work with automatic labels as above.

## Can creatures move through hunger of hadar on the Z axis?

A killer whale is breaking up through ice, flying through the air, then submerging back into the water. If one was to cast hunger of hadar under the whale while it is in the air, can it cross through back into the water?

## Joystick servo control axis value when idle (unity)

When the joystick servo control is idle (user not moving it) , i don’t believe the axis value will be 0 because there’s a lot of thing that interfere with the value (such as calibration , inaccuracy , physics problem in real life , ect . . ) . Is anybody have tested at which range the joystick servo control axis value is safe to be considered as idle? (both negative and positive) . I’m looking for constants here.

To anyone confused what does i meant with joystick servo control , picture below :
(ps : not my image, i found it on google)

## Is there an algorithm to check if two spheres are in collision and whether they’re colliding on the x or the x axis?

I was wondering if there was a way to find out whether a spheres is intersecting another sphere on either its x or its z axis. For instance, Planet A is moving along the Z Axis towards Planet B a stationary object and when collision occurs I would like to get a reponse that tells me that they collided on the zAxis. I can find out if a collsion has occured using the code below however I’m not sure on how to impliment the directional aspect of this. Any help would be appreciated.

``    enum ECol { x_Axis, z_Axis, none };      // Collision detection between two spheres      distanceX = sphere2XPosition - sphere1XPosition;     distanceZ = sphere2ZPosition - sphere1ZPosition;     distance = sqrt(distanceX * distanceX + distanceZ * distanceZ );      if (distance < (sphere1Radius + sphere2Radius))     { // Collision occurred } ``

## mutiply x axis by a factor

i have this equation

`` (3.47471*10^31 (3.525 + 3.83003*10^-10 F^2))/(0.5814 +   9.89982*10^-10 F^2 + 1.05946*10^-20 F^4) ``

i can plot it simply. however i want to multiply x and y axes by a desired factor, i can do it for y axis, how can i modify the x axis?

``Plot[Evaluate[{10^-9 \[Kappa]e}], {F, 0, 2 10^17},  PlotRange -> {Automatic, {0, 10}}, Frame -> True, AspectRatio -> 1,  FrameLabel -> {"B/\[Rho](G.\!\(\*SuperscriptBox[\(cm\), \ \(2\)]\).\!\(\*SuperscriptBox[\(g\), \(-1\)]\))",  "(\!\(\*SubscriptBox[\(\[Kappa]\), \ \(e\)]\))\[Times]\!\(\*SuperscriptBox[\(10\), \ \(9\)]\)(\!\(\*SuperscriptBox[\(cm\), \(-1\)]\).\!\  (\*SuperscriptBox[\ \(s\), \(-1\)]\))"},  FrameStyle -> Directive[Bold, Black, (FontSize -> 15)],  PlotLegends ->  Placed[LineLegend[{Style[   "\!\(\*SubscriptBox[\(\[Kappa]\), \(i\)]\)", "Times", 15,    Bold]}], {0.85, 0.85}],  PlotStyle -> {Blue, Directive[Red, Dashed]}] ``