surface

Estimate the gradient of an undefined surface

余生长醉 提交于 2019-12-06 03:37:22
问题 I want to estimate the gradient (slope and aspect) of an undefined surface (i.e., the function is unknown). To test my methods, here is the test data: require(raster); require(rasterVis) set.seed(123) x <- runif(100, min = 0, max = 1) y <- runif(100, min = 0, max = 1) e <- 0.5 * rnorm(100) test <- expand.grid(sort(x),sort(y)) names(test)<-c('X','Y') z1 <- (5 * test$X^3 + sin(3*pi*test$Y)) realy <- matrix(z1, 100, 100, byrow = F) # And a few plots for demonstration # persp(sort(x), sort(y),

Determining which screen a window is on (by checking where the most surfacearea is located)

拟墨画扇 提交于 2019-12-05 19:55:30
I'm currently determining which screen a window is on, by checking on which screen it's very left-top position is. Now I'd like to change that so that I can find out on which scren the most surface area of the window is to be found. Any ideas how that can be accomplished? Here is my old code: (it simply moves the active window between all available screens when pressing F1) F1:: WinGetPos, X, Y,,, A window := {x:X,y:Y} monitors := GetMonitors() Loop % monitors.MaxIndex() { curMonitor := monitors[A_Index] If IsPointInRectange(window,curMonitor) { nextMonitorIndex := (A_Index = monitors.MaxIndex

Detect MS Surface Virtual Keyboard in Javascript

时光怂恿深爱的人放手 提交于 2019-12-05 17:55:27
Is there a way to detect when the virtual keyboard of the MS Surface is being displayed in a web page via Javascript. The virtual keyboard is covering up the active text field on a page, and I need to be able to detect this so that I can re-layout the page to work better with the remaining window area. 来源: https://stackoverflow.com/questions/29997889/detect-ms-surface-virtual-keyboard-in-javascript

Assigning surfaces to zones based on the 3D regions they enclose

为君一笑 提交于 2019-12-05 16:18:14
Given a set of surfaces in three-dimensional space, I am attempting to assign each surface to a zone referring to the smallest 3D region the set encloses, or no zone if this is not applicable. I also want to determine if a surface is an interface between two zones. So, for example, if we had 11 surfaces representing two cubes stacked on top of each other, the surfaces in the top cube would be in the same zone and the surfaces in the bottom would be in a different zone (with the interface surface being in both zones). As an example, I want to take in a set of surfaces such as this and turn it

Plot a 3d surface from a 'list of lists' using matplotlib

最后都变了- 提交于 2019-12-04 10:26:08
I've searched around for a bit, and whhile I can find many useful examples of meshgrid, none shhow clearly how I can get data from my list of lists into an acceptable form for any of the varied ways I've seen talked about. I'm a bit lost when it comes to numpy/matplotlib and the terminologies and sequences of steps that I have seen suggested. The closest I found was Plotting a 3d surface from a list of tuples in matplotlib I have a list of lists of height data. data=[[h1,h2,h3,h...], [h,h,h,h], [h,h,h,h], [h,h,h,h16]] data[0][1]==h2 data[4][4]==h16 How do I produce a simple 3d surface plot of

Algorithm for simplifying 3d surface?

微笑、不失礼 提交于 2019-12-04 10:15:22
问题 I have a set of 3d points that approximate a surface. Each point, however, are subject to some error. Furthermore, the set of points contain a lot more points than is actually needed to represent the underlying surface. What I am looking for is an algorithm to create a new (much smaller) set of points representing a simplified, smoother version of the surface (pardon for not having a better definition than "simplified, smoother"). The underlying surface is not a mathematical one so I'm not

Incorrect graph when trying to plot z = x + y with MATLAB

拟墨画扇 提交于 2019-12-04 04:09:34
问题 I am attempting to plot 3D surfaces in MATLAB, and I made use of meshgrid , similar to what the MATLAB tutorials said here: http://www.mathworks.com/help/matlab/ref/meshgrid.html I wrote a very simple three line script that I believed would produce the surface z = x + y and it is as follows: [x , y] = meshgrid( linspace( 0 , 10 , 10 ) , linspace( 0 , 10 , 10 ) ); z = x + y; surf( [ x , y , z] ); From what I understand, line 1 produces all combinations of (x,y) coordinates evenly spaced from 0

Displaying Contours in front of Surface in matplotlib

戏子无情 提交于 2019-12-04 03:26:36
问题 I've been looking around for answers but I can't seem to see why in my code I can't get the projected contours to show up "behind" the surface. from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as plt from matplotlib import cm from mpl_toolkits.mplot3d import Axes3D import numpy as np fig = plt.figure() ax = fig.gca(projection='3d') X = np.array([[200,800,1500,2000,3000],[200,700,1500,2000,3000],[200,800,1500,2000,3000],[200,800,1500,2000,3000]]) Y = np.array([[50,50,50,50,50],

Smooth cone normals

倾然丶 夕夏残阳落幕 提交于 2019-12-04 02:00:13
问题 I'm trying to calculate smooth normals for a cone. In looking around for code samples and explanations, I consistently come across directions for face normals. I've posted a couple pictures below of what I'm doing. The first -- which basically just normalizes the vertex position -- gives me decently smooth shading, but the edges are "missing" and the bottom face isn't solid. The second has edges, but the shading is flat (face normals) and my light isn't reflecting off of them correctly. The

Surface and 3d contour in matplotlib

纵然是瞬间 提交于 2019-12-03 17:13:30
问题 I would like to plot a surface with a colormap, wireframe and contours using matplotlib . Something like this: Notice that I am not asking about the contours that lie in the plane parallel to xy but the ones that are 3D and white in the image. If I go the naïve way and plot all these things I cannot see the contours (see code and image below). import numpy as np from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111, projection="3d"