sin

How can I use scipy.ndimage.interpolation.affine_transform to rotate an image about its centre?

匿名 (未验证) 提交于 2019-12-03 02:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am perplexed by the API to scipy.ndimage.interpolation.affine_transform . And judging by this issue I'm not the only one. I'm actually wanting to do more interesting things with affine_transform than just rotating an image, but a rotation would do for starters. (And yes I'm well aware of scipy.ndimage.interpolation.rotate , but figuring out how to drive affine_transform is what interests me here). When I want to do this sort of thing in systems like OpenGL, I'm think in terms of computing the transform which applies a 2x2 rotation matrix R

MySQL Great Circle Distance (Haversine formula)

匿名 (未验证) 提交于 2019-12-03 02:01:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've got a working PHP script that gets Longitude and Latitude values and then inputs them into a MySQL query. I'd like to make it solely MySQL. Here's my current PHP Code: if ($distance != "Any" && $customer_zip != "") { //get the great circle distance //get the origin zip code info $zip_sql = "SELECT * FROM zip_code WHERE zip_code = '$customer_zip'"; $result = mysql_query($zip_sql); $row = mysql_fetch_array($result); $origin_lat = $row['lat']; $origin_lon = $row['lon']; //get the range $lat_range = $distance/69.172; $lon_range = abs(

Haversine Formula in Python (Bearing and Distance between two GPS points)

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Problem I would like to know how to get the distance and bearing between 2 GPS points . I have researched on the haversine formula. Someone told me that I could also find the bearing using the same data. Edit Everything is working fine but the bearing doesn't quite work right yet. The bearing outputs negative but should be between 0 - 360 degrees. The set data should make the horizontal bearing 96.02166666666666 and is: Start point: 53.32055555555556 , -1.7297222222222221 Bearing: 96.02166666666666 Distance: 2 km Destination point: 53

Need to merge multiple pdf's into a single PDF with Table Of Contents sections

匿名 (未验证) 提交于 2019-12-03 01:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Will have 50-100 single PDF's that we'll be generating with a php script. PDF's are generally grouped into groups of 10-20. Each group needs to have it's own Table of Contents or Index, and then there also needs to be a Master Table of Contents or Index at the beginning. Or if that is too difficult we could get away with a single Table of Contents at the beginning. What's the best way to go about this? Will we need to create the Table of Contents and then export that to PDF and append it to the beginning and mash the rest of the

Kendo grid batch editing - making a single call to save

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: With Kendo grid batch editing turned on, I know that you can hook into the create, update and destroy commands where Kendo will send 3 separate commands to the server when you click on Save Changes. I was wondering if there was any way to send all three sets of updates as a single call to the server -like a transaction. Or even send each in a specified order, with a check for success before sending the next . The only way I could come up with was to have a custom Save Changes implementation which ,when invoked, would lookup the

Noise in background when generating sine wave in Java

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm getting a slight distortion (sounds like buzzing) in the background when I run the following code. Because of its subtle nature it makes believe there is some sort of aliasing going on with the byte casting. AudioFormat = PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, big-endian Note : code assumes (for now) that the data is in big endian. public static void playFreq(AudioFormat audioFormat, double frequency, SourceDataLine sourceDataLine) { System.out.println(audioFormat); double sampleRate = audioFormat.getSampleRate(); int

Can't bind to 'ngIf' since it isn't a known property of 'div' [duplicate]

匿名 (未验证) 提交于 2019-12-03 01:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This question already has an answer here: Can't bind to 'ng-forOf' since it isn't a known native property 6 answers Can't bind to 'ngIf' since it isn't a known property of 'div'. The element is And the component is: import SessionService from '../session/session.service'; import { Component } from '@angular/core'; @Component({ providers: [], selector: 'navbar-left', styles: [require('./navbar-left.scss')], template: require('./navbar-left.html'), }) export default class NavbarLeftComponent { public isAuth: boolean = false; constructor

Easting northing to latitude longitude

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've got coordinates of location in easting/northing format but I need to convert it to proper lat long to center it in bing maps. Any formula or details how to convert easting/northing to lat/lon? EDIT: To be more specific, I need to convert SVY21 coordinates to the to WGS84 回答1: Eastings and northings are distances east and north, respectively, of a base point. The base point is usually a latitude and longitude, and eastings and northings are normally expressed in meters or feet. The easting and northing, however, is usually offset a

I need an equation for equal movement along an ellipse

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i am programing something like planets moving around the Sun, and to move planets i am using a function CGPointMake(object.center.x + 1, sqrt(75*75*150*150 - 75*75*(object.center.x - 300)*(object.center.x - 300))/150 + 150) using eliptic equation where a = 150, b = 75, p = 300, q = 150, but when object closes to x = around 450 its speed rises, i guess that is because of pitagora because the path its passes is c = sqrt((x-x0)^2*(y-y0)^2) i notice my c is always around 0.5, but when it gets on the end of x domain it rises up to 0.8 so i need

What's the origin of this GLSL rand() one-liner?

匿名 (未验证) 提交于 2019-12-03 01:00:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've seen this pseudo-random number generator for use in shaders referred to here and there around the web : float rand(vec2 co){ return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); } It's variously called "canonical", or "a one-liner I found on the web somewhere". What's the origin of this function? Are the constant values as arbitrary as they seem or is there some art to their selection? Is there any discussion of the merits of this function? EDIT: The oldest reference to this function that I've come across is this archive